Skip to content

Commit da460a8

Browse files
committed
Create separate version builds
1 parent 7b633ab commit da460a8

File tree

4 files changed

+112
-7
lines changed

4 files changed

+112
-7
lines changed

build.sh

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,19 @@
22

33
set -e
44

5-
versions=("7.2" "7.3" "7.4")
6-
default_version="7.3"
7-
for version in $versions; do
8-
docker build --build-arg DOCKSAL_CLI=2-php${version} -t outrigger/cli:2-php${version} .
5+
# Get the versions to build
6+
7+
# If they are passed as args
8+
if [ $# -gt 0 ]; then
9+
buildDirs="$@"
10+
else
11+
# else, get all the relevant dirs
12+
buildDirs=$(ls | grep -E '^php[0-9\.]+$')
13+
fi
14+
15+
# Build each one of them
16+
for version in $buildDirs; do
17+
pushd $version
18+
docker build -t outrigger/cli:2-${version} .
19+
popd
920
done
10-
#docker tag "outrigger/cli:2-php${default_version}" "outrigger/cli:latest"

Dockerfile renamed to php7.2/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#
33
# Note how we use cli:2 here, which refers the latest available 2.x version
44
# So that we wouldn't need to update this every time new version of Docksal cli releases
5-
ARG DOCKSAL_CLI=2-php7.3
6-
FROM docksal/cli:$DOCKSAL_CLI
5+
FROM docksal/cli:2-php7.2
76

87
# Puppeteer dependencies taken from https://github.com/alekzonder/docker-puppeteer
98
# Install addtional apt packages needed for pa11y and puppeteer

php7.3/Dockerfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Extend the Docksal CLI per https://docs.docksal.io/stack/extend-images/
2+
#
3+
# Note how we use cli:2 here, which refers the latest available 2.x version
4+
# So that we wouldn't need to update this every time new version of Docksal cli releases
5+
FROM docksal/cli:2-php7.3
6+
7+
# Puppeteer dependencies taken from https://github.com/alekzonder/docker-puppeteer
8+
# Install addtional apt packages needed for pa11y and puppeteer
9+
# Added vim.
10+
RUN apt-get update && \
11+
apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \
12+
libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \
13+
libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \
14+
libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \
15+
fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst \
16+
ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget vim && \
17+
apt-get --purge remove && \
18+
apt-get clean && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
19+
20+
ARG HELM_VERSION=v2.12.3
21+
22+
# Next install tools from phase2/docker-gitlab-ci-workspace
23+
RUN curl -o /usr/local/bin/kubectl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \
24+
chmod +x /usr/local/bin/kubectl && \
25+
curl -o ./install_helm.sh https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get && \
26+
chmod +x ./install_helm.sh && \
27+
./install_helm.sh -v ${HELM_VERSION} && \
28+
helm init --client-only
29+
30+
# All further commands will be performed as the docker user.
31+
USER docker
32+
SHELL ["/bin/bash", "-c"]
33+
34+
# Remove ruby from Docksal CLI
35+
RUN \
36+
# Initialize the user environment (this loads rvm)
37+
. $HOME/.profile && \
38+
rvm remove ruby-${RUBY_VERSION_INSTALL}
39+
40+
# Install additional global npm dependencies
41+
RUN \
42+
# Initialize the user environment (this loads nvm)
43+
. $HOME/.profile && \
44+
# Install node packages
45+
npm install -g [email protected] pa11y@5 pa11y-ci@2 http-server
46+
47+
# IMPORTANT! Switching back to the root user as the last instruction.
48+
USER root

php7.4/Dockerfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Extend the Docksal CLI per https://docs.docksal.io/stack/extend-images/
2+
#
3+
# Note how we use cli:2 here, which refers the latest available 2.x version
4+
# So that we wouldn't need to update this every time new version of Docksal cli releases
5+
FROM docksal/cli:2-php7.4
6+
7+
# Puppeteer dependencies taken from https://github.com/alekzonder/docker-puppeteer
8+
# Install addtional apt packages needed for pa11y and puppeteer
9+
# Added vim.
10+
RUN apt-get update && \
11+
apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \
12+
libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \
13+
libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \
14+
libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \
15+
fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst \
16+
ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget vim && \
17+
apt-get --purge remove && \
18+
apt-get clean && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
19+
20+
ARG HELM_VERSION=v2.12.3
21+
22+
# Next install tools from phase2/docker-gitlab-ci-workspace
23+
RUN curl -o /usr/local/bin/kubectl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \
24+
chmod +x /usr/local/bin/kubectl && \
25+
curl -o ./install_helm.sh https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get && \
26+
chmod +x ./install_helm.sh && \
27+
./install_helm.sh -v ${HELM_VERSION} && \
28+
helm init --client-only
29+
30+
# All further commands will be performed as the docker user.
31+
USER docker
32+
SHELL ["/bin/bash", "-c"]
33+
34+
# Remove ruby from Docksal CLI
35+
RUN \
36+
# Initialize the user environment (this loads rvm)
37+
. $HOME/.profile && \
38+
rvm remove ruby-${RUBY_VERSION_INSTALL}
39+
40+
# Install additional global npm dependencies
41+
RUN \
42+
# Initialize the user environment (this loads nvm)
43+
. $HOME/.profile && \
44+
# Install node packages
45+
npm install -g [email protected] pa11y@5 pa11y-ci@2 http-server
46+
47+
# IMPORTANT! Switching back to the root user as the last instruction.
48+
USER root

0 commit comments

Comments
 (0)