New entrypoint
This commit is contained in:
@@ -75,14 +75,12 @@ jobs:
|
|||||||
registry: ${{ vars.REGISTRY }}
|
registry: ${{ vars.REGISTRY }}
|
||||||
username: ${{ vars.DEPLOY_USER }}
|
username: ${{ vars.DEPLOY_USER }}
|
||||||
password: ${{ secrets.DEPLOY_TOKEN }}
|
password: ${{ secrets.DEPLOY_TOKEN }}
|
||||||
add-hosts: ${{ vars.ADD_HOSTS }}
|
|
||||||
- name: Build and push receiver container
|
- name: Build and push receiver container
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ vars.REGISTRY }}/ham/hamview-receiver:latest
|
tags: ${{ vars.REGISTRY }}/ham/hamview-receiver:latest
|
||||||
context: .
|
context: .
|
||||||
add-hosts: ${{ vars.ADD_HOSTS }}
|
|
||||||
platforms: |
|
platforms: |
|
||||||
linux/amd64
|
linux/amd64
|
||||||
linux/arm/v6
|
linux/arm/v6
|
||||||
|
|||||||
14
Dockerfile
14
Dockerfile
@@ -1,8 +1,12 @@
|
|||||||
FROM alpine:3
|
FROM alpine:3
|
||||||
|
RUN apk add --no-cache dumb-init=1.2.5-r4
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
ARG TARGETVARIANT
|
ARG TARGETVARIANT
|
||||||
COPY ./etc /etc/hamview
|
COPY ./etc /app/config
|
||||||
COPY ./build/hamview-receiver-${TARGETARCH}${TARGETVARIANT#v} /opt/hamview/bin/hamview-receiver
|
COPY ./build/hamview-receiver-${TARGETARCH}${TARGETVARIANT#v} /app/hamview-receiver
|
||||||
WORKDIR /opt/hamview
|
COPY ./entrypoint.sh /entrypoint.sh
|
||||||
ENTRYPOINT ["bin/hamview-receiver"]
|
|
||||||
CMD [ "protocol" ]
|
ENTRYPOINT ["dumb-init", "/entrypoint.sh"]
|
||||||
|
|||||||
17
entrypoint.sh
Executable file
17
entrypoint.sh
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
run() {
|
||||||
|
case "${PROTOCOL}" in
|
||||||
|
"") exec "/app/hamview-receiver" help ;;
|
||||||
|
*) exec "/app/hamview-receiver" --config "/app/config/hamview-${PROTOCOL}.yaml" "${PROTOCOL}" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$@" in
|
||||||
|
"")
|
||||||
|
run
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
exec "/bin/sh" -c "$@"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
Reference in New Issue
Block a user