Skip to content

Commit 34d819d

Browse files
committed
Update dockerfile and CI
1 parent 5adc164 commit 34d819d

5 files changed

Lines changed: 169 additions & 51 deletions

File tree

.github/workflows/default.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
name: 'build images'
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
name: "Build: ${{ matrix.version }}"
13+
runs-on: ubuntu-20.04
14+
15+
strategy:
16+
fail-fast: false # Don't cancel other jobs if one fails
17+
matrix:
18+
include:
19+
- version: '7.4'
20+
- version: '8.0'
21+
- version: '8.1'
22+
23+
env:
24+
VERSION: ${{ matrix.version }}
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v2
29+
30+
- name: Prepare
31+
id: prep
32+
run: |
33+
DOCKER_IMAGE=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPOSITORY#*/}
34+
VERSION=php${{ matrix.version }}
35+
SHORTREF=${GITHUB_SHA::8}
36+
37+
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHORTREF}"
38+
39+
# Set output parameters.
40+
echo ::set-output name=tags::${TAGS}
41+
echo ::set-output name=docker_image::${DOCKER_IMAGE}
42+
43+
- name: Set up QEMU
44+
uses: docker/setup-qemu-action@v1
45+
with:
46+
platforms: all
47+
48+
- name: Set up Docker Buildx
49+
id: buildx
50+
uses: docker/setup-buildx-action@v1
51+
52+
- name: Login to DockerHub
53+
if: github.event_name != 'pull_request'
54+
uses: docker/login-action@v1
55+
with:
56+
username: ${{ secrets.DOCKER_USERNAME }}
57+
password: ${{ secrets.DOCKER_TOKEN }}
58+
# -
59+
# name: Login to GitHub Container Registry
60+
# uses: docker/login-action@v1
61+
# with:
62+
# registry: ghcr.io
63+
# username: ${{ github.repository_owner }}
64+
# password: ${{ secrets.GITHUB_TOKEN }}
65+
66+
- name: Build
67+
uses: docker/build-push-action@v2
68+
with:
69+
builder: ${{ steps.buildx.outputs.name }}
70+
context: ./src
71+
file: ./src/Dockerfile
72+
build-args: CLI_VERSION=php${{ matrix.version }}
73+
platforms: linux/amd64,linux/arm64
74+
push: true
75+
tags: ${{ steps.prep.outputs.tags }}

.hadolint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ignored:
2+
- DL4001

Dockerfile

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/Dockerfile

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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

src/awscli.pubkey

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
-----BEGIN PGP PUBLIC KEY BLOCK-----
2+
3+
mQINBF2Cr7UBEADJZHcgusOJl7ENSyumXh85z0TRV0xJorM2B/JL0kHOyigQluUG
4+
ZMLhENaG0bYatdrKP+3H91lvK050pXwnO/R7fB/FSTouki4ciIx5OuLlnJZIxSzx
5+
PqGl0mkxImLNbGWoi6Lto0LYxqHN2iQtzlwTVmq9733zd3XfcXrZ3+LblHAgEt5G
6+
TfNxEKJ8soPLyWmwDH6HWCnjZ/aIQRBTIQ05uVeEoYxSh6wOai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