Skip to content

Commit

Permalink
chore(Dockerfile): add local-dev-env build stage (PROJQUAY-2501) (#883)
Browse files Browse the repository at this point in the history
When specified, the new build target (aka stage) builds quay the way
local-dev/Dockerfile used to, using local-dev/config.yml as
configuration, and starting up only the necessary tools for development.
See docker-compose.yml services:quay:build:target for how it's used.

Production builds should not be affected since the new target is not
referenced from anywhere but the docker-compose.yml.
  • Loading branch information
flavianmissi authored Sep 17, 2021
1 parent 495dd90 commit 0f7fdb7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 66 deletions.
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,26 @@ RUN curl -fsSL "https://github.com/quay/config-tool/archive/${CONFIGTOOL_VERSION
COPY --from=config-editor /build/static/build /go/src/config-tool/pkg/lib/editor/static/build
RUN go install ./cmd/config-tool

# Local dev only target. DO NOT USE FOR PROD!
# It is similar to the `final` target, but uses development config.
FROM base AS local-dev-env
ENV QUAYCONF /quay-registry/local-dev

RUN alternatives --set python /usr/bin/python3

WORKDIR $QUAYDIR

# Ordered from least changing to most changing.
COPY --from=jwtproxy /usr/local/bin/jwtproxy /usr/local/bin/jwtproxy
COPY --from=pushgateway /usr/local/bin/pushgateway /usr/local/bin/pushgateway
COPY --from=build-python /app /app
COPY --from=build-static /build/static ${QUAYDIR}/static

EXPOSE 8080 8443 7443 9091 55443

ENTRYPOINT ["dumb-init", "--", "/quay-registry/quay-entrypoint.sh"]
CMD ["registry"]

# Final is the end container, where all the work from the other
# containers are copied in.
FROM base AS final
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ services:

quay:
container_name: quay-quay
build:
build:
context: .
dockerfile: ./local-dev/Dockerfile
target: local-dev-env
image: quay-local:local
volumes:
- ".:/quay-registry"
Expand Down
64 changes: 0 additions & 64 deletions local-dev/Dockerfile

This file was deleted.

0 comments on commit 0f7fdb7

Please sign in to comment.