Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Dockerfile compatible with ARM #84

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/docker-arm-v6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# A single-shot build-n-pack on Alpine Linux
name: Publish Docker image (ARM v6)
on: [push]

jobs:
push_to_registry:
name: Build Docker image (ARM v6)
runs-on: ubuntu-latest
steps:
- name: Check token is set
id: vars
shell: bash
run: |
unset HAS_SECRET
if [ -n $SECRET ]; then HAS_SECRET='true' ; fi
echo ::set-output name=HAS_SECRET_TOKEN::${HAS_SECRET}
env:
SECRET: "${{ secrets.DOCKER_TOKEN }}"
- name: Check out the repo
uses: actions/checkout@v2
if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }}
- name: Convert username to lower case for docker
id: string_user
uses: ASzc/change-string-case-action@v1
with:
string: ${{ github.repository_owner }}
- name: Convert repo to lower case for docker
id: string_repo
uses: ASzc/change-string-case-action@v1
with:
string: ${{ github.repository }}
- name: Set up QEMU
if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }}
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }}
uses: docker/setup-buildx-action@v1
- name: Login to dockerhub
if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }}
uses: docker/login-action@v1
with:
username: ${{ steps.string_user.outputs.lowercase }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Get tag name
if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }}
id: tags
run: |
branch="${GITHUB_REF#refs/heads/}"
tags="${REPO_NAME}:${branch}"
if [ "${branch}" == "master" ]; then
tags="${tags},${REPO_NAME}:latest"
fi
echo "::set-output name=TAGS::${tags}"
env:
REPO_NAME: ${{ steps.string_repo.outputs.lowercase }}
- name: Push to Docker Hub Debian
if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }}
uses: docker/build-push-action@v2
with:
platforms: linux/arm/v6
push: true
file: Dockerfile
tags: ${{ steps.tags.outputs.TAGS }}
33 changes: 28 additions & 5 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,35 @@ jobs:
uses: ASzc/change-string-case-action@v1
with:
string: ${{ github.repository }}
- name: Push to Docker Hub
uses: docker/build-push-action@v1
- name: Set up QEMU
if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }}
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }}
uses: docker/setup-buildx-action@v1
- name: Login to dockerhub
if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }}
uses: docker/login-action@v1
with:
username: ${{ steps.string_user.outputs.lowercase }}
password: ${{ secrets.DOCKER_TOKEN }}
registry: docker.io
repository: ${{ steps.string_repo.outputs.lowercase }}
tag_with_ref: true
- name: Get tag name
if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }}
id: tags
run: |
branch="${GITHUB_REF#refs/heads/}"
tags="${REPO_NAME}:${branch}"
if [ "${branch}" == "master" ]; then
tags="${tags},${REPO_NAME}:latest"
fi
echo "::set-output name=TAGS::${tags}"
env:
REPO_NAME: ${{ steps.string_repo.outputs.lowercase }}
- name: Push to Docker Hub Debian
if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }}
uses: docker/build-push-action@v2
with:
platforms: linux/arm/v7,linux/arm64/v8,linux/amd64
push: true
file: Dockerfile
tags: ${{ steps.tags.outputs.TAGS }}
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
# Copyright (c) 2020 George Hilliard
# SPDX-License-Identifier: AGPL-3.0-only

FROM docker.io/rust:1-alpine AS build
FROM docker.io/alpine AS build
MAINTAINER thirtythreeforty@gmail.com

RUN apk add rust cargo
RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing \
gst-rtsp-server-dev
RUN apk add --no-cache musl-dev gcc
Expand Down Expand Up @@ -34,7 +35,9 @@ COPY --from=build \
/usr/local/src/neolink/target/release/neolink \
/usr/local/bin/neolink
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

CMD ["/usr/local/bin/neolink", "--config", "/etc/neolink.toml"]
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 8554
EXPOSE 8554