|
| 1 | +ARG VERSION=0.9 |
| 2 | + |
| 3 | +# 1. First reference the gearbox-base image. |
| 4 | +FROM gearboxworks/gearbox-base:alpine-3.11 as gearbox-base |
| 5 | + |
| 6 | +# 2. Next reference the third party image. |
| 7 | +FROM composer:1.10.0 |
| 8 | +ARG VERSION |
| 9 | +ARG GEARBOX_ENTRYPOINT |
| 10 | +ARG GEARBOX_ENTRYPOINT_ARGS |
| 11 | +USER root |
| 12 | + |
| 13 | +# 3. Copy the build directory over from gearbox-base image. |
| 14 | +COPY --from=gearbox-base /etc/gearbox /etc/gearbox |
| 15 | + |
| 16 | +# 4. Set up env variables. |
| 17 | +MAINTAINER Gearbox Team <team@gearbox.works> |
| 18 | +ENV GEARBOX_CONTAINER_NAME "docker-deploywp" |
| 19 | +ENV GEARBOX_CONTAINER_VERSION ${VERSION} |
| 20 | +ENV GEARBOX_ENTRYPOINT ${GEARBOX_ENTRYPOINT} |
| 21 | +ENV GEARBOX_ENTRYPOINT_ARGS ${GEARBOX_ENTRYPOINT_ARGS} |
| 22 | +LABEL gearbox.json='{"schema": "gear-1","meta": {"state": "production","organization": "gearboxworks","name": "deploywp","label": "Composer","maintainer": "Gearbox Team <team@gearbox.works>","class": "dev","refurl": "https://getcomposer.org/"},"build": {"ports": {},"run": "","args": "","env": {"COMPOSER_USER": "gearbox"},"network": "--network gearboxnet","volumes": "","restart": "--restart no"},"run": {"commands": {"default": "deploywp","deploywp": "deploywp"}},"project": {},"extensions": {},"versions": {"1.1.3": {"majorversion": "1.1","latest": false,"ref": "composer:1.1.3","base": "gearboxworks/gearbox-base:alpine-3.4"},"1.2.4": {"majorversion": "1.2","latest": false,"ref": "composer:1.2.4","base": "gearboxworks/gearbox-base:alpine-3.4"},"1.3.3": {"majorversion": "1.3","latest": false,"ref": "composer:1.3.3","base": "gearboxworks/gearbox-base:alpine-3.4"},"1.4.3": {"majorversion": "1.4","latest": false,"ref": "composer:1.4.3","base": "gearboxworks/gearbox-base:alpine-3.7"},"1.5.6": {"majorversion": "1.5","latest": false,"ref": "composer:1.5.6","base": "gearboxworks/gearbox-base:alpine-3.7"},"1.6.5": {"majorversion": "1.6","latest": false,"ref": "composer:1.6.5","base": "gearboxworks/gearbox-base:alpine-3.8"},"1.7.3": {"majorversion": "1.7","latest": false,"ref": "composer:1.7.3","base": "gearboxworks/gearbox-base:alpine-3.10"},"1.8.6": {"majorversion": "1.8","latest": false,"ref": "composer:1.8.6","base": "gearboxworks/gearbox-base:alpine-3.11"},"1.9.3": {"majorversion": "1.9","latest": false,"ref": "composer:1.9.3","base": "gearboxworks/gearbox-base:alpine-3.11"},"0.9": {"majorversion": "1.10","latest": true,"ref": "composer:1.10.0","base": "gearboxworks/gearbox-base:alpine-3.11"}}}' |
| 23 | +LABEL gearbox.version='0.9' |
| 24 | +ENV GEARBOX_VERSION "0.9" |
| 25 | +LABEL container.class="dev" |
| 26 | +ENV GEARBOX_CLASS "dev" |
| 27 | +LABEL container.label="Composer" |
| 28 | +ENV GEARBOX_LABEL "Composer" |
| 29 | +LABEL container.maintainer="Gearbox Team <team@gearbox.works>" |
| 30 | +ENV GEARBOX_MAINTAINER "Gearbox Team <team@gearbox.works>" |
| 31 | +LABEL container.name="deploywp" |
| 32 | +ENV GEARBOX_NAME "deploywp" |
| 33 | +LABEL container.organization="gearboxworks" |
| 34 | +ENV GEARBOX_ORGANIZATION "gearboxworks" |
| 35 | +LABEL container.refurl="https://getcomposer.org/" |
| 36 | +ENV GEARBOX_REFURL "https://getcomposer.org/" |
| 37 | +LABEL container.state="production" |
| 38 | +ENV GEARBOX_STATE "production" |
| 39 | +LABEL container.args="" |
| 40 | +ENV GEARBOX_ARGS "" |
| 41 | +# SKIP env |
| 42 | +LABEL container.network="--network gearboxnet" |
| 43 | +ENV GEARBOX_NETWORK "--network gearboxnet" |
| 44 | +LABEL container.ports="map[]" |
| 45 | +ENV GEARBOX_PORTS "map[]" |
| 46 | +LABEL container.restart="--restart no" |
| 47 | +ENV GEARBOX_RESTART "--restart no" |
| 48 | +LABEL container.run="" |
| 49 | +ENV GEARBOX_RUN "" |
| 50 | +LABEL container.volumes="" |
| 51 | +ENV GEARBOX_VOLUMES "" |
| 52 | +LABEL container.base="gearboxworks/gearbox-base:alpine-3.11" |
| 53 | +ENV GEARBOX_BASE "gearboxworks/gearbox-base:alpine-3.11" |
| 54 | +LABEL container.latest="true" |
| 55 | +ENV GEARBOX_LATEST "true" |
| 56 | +LABEL container.majorversion="" |
| 57 | +ENV GEARBOX_MAJORVERSION "" |
| 58 | +LABEL container.ref="composer:1.10.0" |
| 59 | +ENV GEARBOX_REF "composer:1.10.0" |
| 60 | +ENV COMPOSER_USER "gearbox" |
| 61 | + |
| 62 | +# 5. Now copy the local files specific to this container. |
| 63 | +COPY build /etc/gearbox |
| 64 | + |
| 65 | +# 6. Run the base.sh script to set everything up. |
| 66 | +RUN /bin/sh /etc/gearbox/build/base.sh |
| 67 | + |
| 68 | +# 7. Run the composer.sh script to set everything up. |
| 69 | +RUN /bin/sh /etc/gearbox/build/composer.sh |
| 70 | + |
| 71 | +# 8. Expose ports. |
| 72 | +EXPOSE 22 9970 |
| 73 | +WORKDIR /home/gearbox/projects |
| 74 | + |
| 75 | +CMD ["/init"] |
| 76 | + |
| 77 | +# END |
| 78 | +################################################################################ |
0 commit comments