Skip to content
This repository has been archived by the owner on Jan 8, 2022. It is now read-only.

Commit

Permalink
Make sure git is added in there, add build information as well (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay authored Jun 15, 2020
1 parent 91abc0d commit dda9d31
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.docker-build-info.txt
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ RUN apt-get -qq install --no-install-recommends --no-install-suggests -y \
ca-certificates \
bzip2 \
curl \
git \
gnupg \
less \
lsb-release \
Expand All @@ -26,13 +27,11 @@ ENV PHP_VERSIONS="php5.6 php7.0 php7.1 php7.2 php7.3 php7.4"
ENV PHP_INI=/etc/php/$PHP_DEFAULT_VERSION/fpm/php.ini
ENV WWW_UID=33
ENV YQ_VERSION=2.4.1
ENV DRUSH_VERSION=8.3.2
ENV DRUSH_VERSION=8.3.5
ENV DRUSH_LAUNCHER_VERSION=0.6.0
ENV DRUSH_LAUNCHER_FALLBACK=/usr/local/bin/drush8
# composer normally screams about running as root, we don't need that.
ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_CACHE_DIR /mnt/ddev-global-cache/composer
# Windows, especially Win10 Home/Docker toolbox, can take forever on composer build.
ENV COMPOSER_PROCESS_TIMEOUT 2000

RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \
Expand Down Expand Up @@ -73,6 +72,7 @@ RUN wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linu
ADD ddev-php-files /
RUN apt-get -qq autoremove && apt-get -qq clean -y && rm -rf /var/lib/apt/lists/*
RUN usermod -u ${WWW_UID} www-data && groupmod -g ${WWW_UID} www-data
ADD /.docker-build-info.txt /
#END ddev-php-base

### ---------------------------ddev-php-prod--------------------------------------
Expand Down
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ DEFAULT_IMAGES = ddev-php-base ddev-php-prod
# This version-strategy uses git tags to set the version string
# VERSION can be overridden on make commandline: make VERSION=0.9.1 push
VERSION := $(shell git describe --tags --always --dirty)
BUILDINFO = $(shell echo hash=$$(git rev-parse --short HEAD) Built $$(date) by $${USER} on $$(hostname) $(BUILD_IMAGE) )

#
# This version-strategy uses a manual value to set the version string
#VERSION := 1.2.3
Expand All @@ -33,10 +35,16 @@ images: $(DEFAULT_IMAGES)
push: images
for item in $(DEFAULT_IMAGES); do docker push $(DOCKER_ORG)/$$item:$(VERSION); echo "pushed $(DOCKER_ORG)/$$item"; done

ddev-php-prod ddev-php-base:
ddev-php-prod ddev-php-base: buildinfo
DOCKER_BUILDKIT=$(DOCKER_BUILDKIT) docker build --label com.ddev.buildhost=${shell hostname} --target=$@ -t $(DOCKER_ORG)/$@:$(VERSION) $(DOCKER_ARGS) .

test: images
for item in $(DEFAULT_IMAGES); do \
if [ -x tests/$$item/test.sh ]; then tests/$$item/test.sh $(DOCKER_ORG)/$$item:$(VERSION); fi; \
done

version:
@echo VERSION:$(VERSION)

buildinfo:
@echo "$(VERSION) $(BUILDINFO)" >.docker-build-info.txt

0 comments on commit dda9d31

Please sign in to comment.