Skip to content

Commit

Permalink
Fix docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
g3force committed May 31, 2023
1 parent 5f1db32 commit b30dfd7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
7 changes: 4 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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.*/ } }
2 changes: 1 addition & 1 deletion cmd/ssl-vision-cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
5 changes: 2 additions & 3 deletions cmd/ssl-vision-client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit b30dfd7

Please sign in to comment.