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 158c94f commit 864bd64
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 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.*/ } }
4 changes: 2 additions & 2 deletions cmd/ssl-game-controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ ARG cmd=ssl-game-controller
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-game-controller
COPY --from=build_go /go/bin/${cmd} /app/${cmd}
RUN mkdir -p config && chown -R 1000: config
USER 1000
Expand Down
2 changes: 1 addition & 1 deletion cmd/ssl-ref-client/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-ref-client
COPY --from=build_go /go/bin/${cmd} /app/${cmd}
USER 1000
ENV COMMAND="/app/${cmd}"
Expand Down

0 comments on commit 864bd64

Please sign in to comment.