Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add COMPOSER_AUTH env var as onbuild arg #45

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ push-$(RUNTIME)-%: .build/tag-$(RUNTIME)-%
$(DOCKER_BUILD) \
$(patsubst %,--build-arg BASE_IMAGE=%,$(BASE_IMAGE)) \
$(patsubst %,--build-arg PHP_BASE_IMAGE=%,$(PHP_BASE_IMAGE)) \
--build-arg COMPOSER_AUTH= \
-t local$@ \
--cache-from $(REGISTRY):$(@:.build/$(RUNTIME)-%=%) \
--cache-from $(REGISTRY):$(@:.build/$(RUNTIME)-%=%)$(TAG_SUFFIX_SLUG) \
Expand Down
9 changes: 7 additions & 2 deletions wordpress/Dockerfile-bedrock-build
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
ARG BASE_IMAGE=quay.io/presslabs/wordpress-runtime:bedrock
FROM ${BASE_IMAGE} as bedrock
WORKDIR /src

# Inject custom env vars as build args
ONBUILD ARG COMPOSER_AUTH
ONBUILD ENV COMPOSER_AUTH ${COMPOSER_AUTH}

# Install project dependencies as first build step for child images so that we
# heat up composer cache
ONBUILD COPY --chown=www-data:www-data composer.json composer.lock /src/
ONBUILD RUN composer install --no-dev --no-interaction --no-progress --no-ansi --no-scripts
ONBUILD RUN COMPOSER_AUTH=${COMPOSER_AUTH} composer install --no-dev --no-interaction --no-progress --no-ansi --no-scripts

ONBUILD COPY --chown=www-data:www-data . /src
ONBUILD RUN composer install --no-dev --no-interaction --no-progress --no-ansi --no-scripts
ONBUILD RUN COMPOSER_AUTH=${COMPOSER_AUTH} composer install --no-dev --no-interaction --no-progress --no-ansi --no-scripts
ONBUILD RUN cp -a /src/. /app