From b30dfd7e075456aa86882c4a188f2d7f3783a410 Mon Sep 17 00:00:00 2001 From: Nicolai Ommer Date: Wed, 31 May 2023 20:55:22 +0200 Subject: [PATCH] Fix docker image --- .circleci/config.yml | 7 ++++--- cmd/ssl-vision-cli/Dockerfile | 2 +- cmd/ssl-vision-client/Dockerfile | 5 ++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5005908..bd08f14 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -86,7 +86,7 @@ jobs: version: 20.10.18 - run: | for cmd in << pipeline.parameters.cmds >>; do - docker build -f ./cmd/${cmd}/Dockerfile -t robocupssl/${cmd}:latest . + docker build --build-arg cmd=${cmd} -f ./cmd/${cmd}/Dockerfile -t robocupssl/${cmd}:latest . done publish_docker: @@ -102,7 +102,7 @@ jobs: TAG=${CIRCLE_TAG:1} TAG=${TAG:-latest} for cmd in << pipeline.parameters.cmds >>; do - docker build -f ./cmd/${cmd}/Dockerfile -t robocupssl/${cmd}:${TAG} . + docker build --build-arg cmd=${cmd} -f ./cmd/${cmd}/Dockerfile -t robocupssl/${cmd}:${TAG} . docker login -u "${DOCKER_HUB_USERNAME}" -p "${DOCKER_HUB_PASSWORD}" docker push robocupssl/${cmd}:${TAG} done @@ -127,7 +127,8 @@ workflows: filters: { branches: { ignore: /.*/ }, tags: { only: /^v.*/ } } docker: jobs: - - build_docker + - build_docker: + filters: { branches: { ignore: master } } - publish_docker: context: docker hub filters: { branches: { only: master }, tags: { only: /^v.*/ } } diff --git a/cmd/ssl-vision-cli/Dockerfile b/cmd/ssl-vision-cli/Dockerfile index f923869..8b7e738 100644 --- a/cmd/ssl-vision-cli/Dockerfile +++ b/cmd/ssl-vision-cli/Dockerfile @@ -6,7 +6,7 @@ RUN go install -v ./cmd/${cmd} # Start fresh from a smaller image FROM alpine:3 -ARG cmd +ARG cmd=ssl-vision-cli COPY --from=build_go /go/bin/${cmd} /app/${cmd} USER 1000 ENV COMMAND="/app/${cmd}" diff --git a/cmd/ssl-vision-client/Dockerfile b/cmd/ssl-vision-client/Dockerfile index 017aeeb..4a4cd41 100644 --- a/cmd/ssl-vision-client/Dockerfile +++ b/cmd/ssl-vision-client/Dockerfile @@ -9,13 +9,12 @@ ARG cmd=ssl-vision-client WORKDIR work COPY . . COPY --from=build_node frontend/dist frontend/dist -RUN go install -v ./cmd/${cmd} +RUN go install ./cmd/${cmd} # Start fresh from a smaller image FROM alpine:3 -ARG cmd +ARG cmd=ssl-vision-client COPY --from=build_go /go/bin/${cmd} /app/${cmd} -RUN mkdir -p config && chown -R 1000: config USER 1000 ENV COMMAND="/app/${cmd}" ENTRYPOINT "${COMMAND}"