|
| 1 | +ARG CLI_VERSION={{cli_version}} |
| 2 | + |
| 3 | +# Extend the Docksal CLI per https://docs.docksal.io/stack/extend-images/ |
| 4 | +FROM docksal/cli:${CLI_VERSION} |
| 5 | + |
| 6 | +# See https://github.com/hadolint/hadolint/wiki/DL4006 |
| 7 | +SHELL ["/bin/bash", "-o", "pipefail", "-c"] |
| 8 | + |
| 9 | +# NOTE: This only works on X86_64 Arch. |
| 10 | +# |
| 11 | +# Puppeteer dependencies taken from https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-puppeteer-in-docker |
| 12 | +# Install addtional apt packages needed for pa11y and puppeteer |
| 13 | +# Add vim |
| 14 | +# hadolint ignore=DL3015,DL3008 |
| 15 | +# RUN apt-get update && \ |
| 16 | +# apt-get install -y wget gnupg && \ |
| 17 | +# wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ |
| 18 | +# sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \ |
| 19 | +# apt-get update && \ |
| 20 | +# apt-get install -y --no-install-recommends google-chrome-stable \ |
| 21 | +# fonts-ipafont-gothic \ |
| 22 | +# fonts-wqy-zenhei \ |
| 23 | +# fonts-thai-tlwg \ |
| 24 | +# fonts-kacst \ |
| 25 | +# fonts-freefont-ttf \ |
| 26 | +# libxss1 \ |
| 27 | +# && \ |
| 28 | +# apt-get install -y vim --no-install-recommends && \ |
| 29 | +# rm -rf /var/lib/apt/lists/* |
| 30 | + |
| 31 | +ARG HELM_VERSION=v2.17.0 |
| 32 | + |
| 33 | +# Install kubectl and helm client |
| 34 | +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/$(dpkg --print-architecture)/kubectl" && \ |
| 35 | + chmod +x /usr/local/bin/kubectl && \ |
| 36 | + curl -o ./install_helm.sh https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get && \ |
| 37 | + chmod +x ./install_helm.sh && \ |
| 38 | + ./install_helm.sh -v ${HELM_VERSION} && \ |
| 39 | + helm init --client-only |
| 40 | + |
| 41 | +# Install AWS cli |
| 42 | +COPY awscli.pubkey /tmp/ |
| 43 | +RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" && \ |
| 44 | + gpg --import /tmp/awscli.pubkey && \ |
| 45 | + curl -s -o awscliv2.sig https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip.sig && \ |
| 46 | + gpg --verify awscliv2.sig awscliv2.zip && \ |
| 47 | + unzip -q awscliv2.zip && \ |
| 48 | + ./aws/install && \ |
| 49 | + rm awscliv2.zip && rm -rf aws |
| 50 | + |
| 51 | +# All further commands will be performed as the docker user. |
| 52 | +USER docker |
| 53 | +SHELL ["/bin/bash", "-c"] |
| 54 | + |
| 55 | +# Install additional global npm dependencies |
| 56 | +RUN \ |
| 57 | + # Initialize the user environment (this loads nvm) |
| 58 | + . "$HOME"/.profile && \ |
| 59 | + # Install node packages |
| 60 | + yarn global add puppeteer@1.20.0 pa11y@5 pa11y-ci@2 http-server |
| 61 | + |
| 62 | +# IMPORTANT! Switching back to the root user as the last instruction. |
| 63 | +USER root |
0 commit comments