Refactor again (#11)

This commit is contained in:
Ryan (hackercat)
2021-05-28 11:31:42 +00:00
committed by GitHub
parent da6b7b185b
commit 6ffb01cfd3
21 changed files with 461 additions and 236 deletions
-4
View File
@@ -1,4 +0,0 @@
general:
vulnerabilities:
bestPracticeViolations:
- DKL-DI-0001 # * FATAL:Avoid sudo command
+5 -5
View File
@@ -1,7 +1,7 @@
version: 2 ---
updates: updates:
# Maintain dependencies for GitHub Actions - directory: /
- package-ecosystem: 'github-actions' package-ecosystem: github-actions
directory: '/'
schedule: schedule:
interval: 'monthly' interval: monthly
version: 2
+3 -1
View File
@@ -1,9 +1,11 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/hadolint/hadolint/master/contrib/hadolint.json
---
ignored: ignored:
- SC2086 - SC2086
- SC2059
- DL3004 - DL3004
- DL3002 - DL3002
- DL3008 - DL3008
- DL3016
- DL3018 - DL3018
- DL3003 - DL3003
trustedRegistries: trustedRegistries:
+108 -54
View File
@@ -1,27 +1,32 @@
name: Build alpine images name: Build alpine images
on: on:
schedule: #schedule:
- cron: 0 12 */7 * * # - cron: 0 12 */7 * *
push: #push:
paths: # paths:
- '.github/workflows/build-alpine.yml' # - '.github/workflows/build-alpine.yml'
- 'linux/alpine/act/**' # - 'linux/alpine/**'
pull_request: # branches:
paths: # - 'master'
- '.github/workflows/build-alpine.yml' #pull_request:
- 'linux/alpine/act/**' # paths:
# - '.github/workflows/build-alpine.yml'
# - 'linux/alpine/**'
workflow_dispatch: workflow_dispatch:
env:
SLUG: ${{ github.repository_owner }}/alpine
IMAGE: alpine
PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7
jobs: jobs:
build: build:
name: Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ ( github.actor == github.repository_owner && github.event_name != 'pull_request' ) || ( github.actor != github.repository_owner ) }} environment: Images
steps: steps:
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
id: ghcr id: ghcr
if: ${{ github.actor == github.repository_owner && !env.ACT }}
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
registry: ghcr.io registry: ghcr.io
@@ -30,7 +35,6 @@ jobs:
- name: Login to Quay - name: Login to Quay
id: quay id: quay
if: ${{ github.actor == github.repository_owner && !env.ACT }}
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
registry: quay.io registry: quay.io
@@ -39,15 +43,21 @@ jobs:
- name: Login to Docker Hub - name: Login to Docker Hub
id: dckr id: dckr
if: ${{ github.actor == github.repository_owner && !env.ACT }}
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
username: ${{ secrets.DOCKER_USER }} username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }} password: ${{ secrets.DOCKER_TOKEN }}
- name: Print date in UTC format - name: Print tag
id: print-date id: print-tag
run: echo "::set-output name=date::$(date +%Y%m%d)" run: |
if [ ${{ github.event_name }} == 'pull_request'}} && ${{ !env.ACT }} ]; then
echo "::set-output name=tag::PR-${{ github.event.number }}"
elif [ "${ACT}" == "true" ]; then
echo "::set-output name=tag::dev"
else
echo "::set-output name=tag::$(date +%Y%m%d)"
fi
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v1
@@ -57,56 +67,100 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Build and push ${{ github.repository_owner }}/alpine:act-${{ steps.print-date.outputs.date }} - name: Build and push ${{ env.SLUG }}:${{ env.TAG }}
id: act
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
env: env:
GHCR_TAG: ghcr.io/${{ github.repository_owner }}/alpine:act TAG: act-${{ steps.print-tag.outputs.tag }}
QUAY_TAG: quay.io/${{ github.repository_owner }}/alpine:act
DCKR_TAG: docker.io/${{ github.repository_owner }}/alpine:act
with: with:
context: . context: .
push: ${{ github.event_name != 'pull_request' && github.event_name != 'push' && !env.ACT }} push: true
file: ./linux/alpine/act/base/Dockerfile file: ./linux/${{ env.IMAGE }}/act/Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7 platforms: ${{ env.PLATFORMS }}
tags: | tags: |
${{ env.GHCR_TAG }} ghcr.io/${{ env.SLUG }}:${{ env.TAG }}
${{ env.GHCR_TAG }}-${{ steps.print-date.outputs.date }} quay.io/${{ env.SLUG }}:${{ env.TAG }}
${{ env.QUAY_TAG }} docker.io/${{ env.SLUG }}:${{ env.TAG }}
${{ env.QUAY_TAG }}-${{ steps.print-date.outputs.date }}
${{ env.DCKR_TAG }}
${{ env.DCKR_TAG }}-${{ steps.print-date.outputs.date }}
build-args: | build-args: |
BASEIMAGE=node IMAGEOS=${{ env.IMAGE }}
TAG=lts-alpine3.13 BUILD_TAG_VERSION=${{ steps.print-tag.outputs.tag }}
DISTRIB_RELEASE=${{ steps.release.outputs.RELEASE }}
BUILD_TAG_VERSION=${{ steps.print-date.outputs.date }}
BUILD_TAG=act BUILD_TAG=act
BUILD_REF=${{ github.sha }} BUILD_REF=${{ github.sha }}
- name: Build and push ${{ github.repository_owner }}/alpine:runner-${{ steps.print-date.outputs.date }} - name: Build and push ${{ env.SLUG }}:${{ env.TAG }}
id: runner
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
if: ${{ github.event_name != 'pull_request' && github.event_name != 'push' && !env.ACT }}
env: env:
GHCR_TAG: ghcr.io/${{ github.repository_owner }}/alpine:runner TAG: runner-${{ steps.print-tag.outputs.tag }}
QUAY_TAG: quay.io/${{ github.repository_owner }}/alpine:runner
DCKR_TAG: docker.io/${{ github.repository_owner }}/alpine:runner
with: with:
context: . context: .
push: ${{ github.event_name != 'pull_request' && github.event_name != 'push' && !env.ACT }} push: true
file: ./linux/alpine/act/runner/Dockerfile file: ./linux/${{ env.IMAGE }}/runner/Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7 platforms: ${{ env.PLATFORMS }}
tags: | tags: |
${{ env.GHCR_TAG }} ghcr.io/${{ env.SLUG }}:${{ env.TAG }}
${{ env.GHCR_TAG }}-${{ steps.print-date.outputs.date }} quay.io/${{ env.SLUG }}:${{ env.TAG }}
${{ env.QUAY_TAG }} docker.io/${{ env.SLUG }}:${{ env.TAG }}
${{ env.QUAY_TAG }}-${{ steps.print-date.outputs.date }}
${{ env.DCKR_TAG }}
${{ env.DCKR_TAG }}-${{ steps.print-date.outputs.date }}
build-args: | build-args: |
BASEIMAGE=catthehacker/alpine IMAGE=ghcr.io/${{ env.SLUG }}
TAG=act-${{ steps.print-date.outputs.date }} IMAGEOS=${{ env.IMAGE }}
BUILD_TAG_VERSION=${{ steps.print-date.outputs.date }} TAG=act-${{ steps.print-tag.outputs.tag }}
BUILD_TAG_VERSION=${{ steps.print-tag.outputs.tag }}
BUILD_TAG=runner BUILD_TAG=runner
BUILD_REF=${{ github.sha }} BUILD_REF=${{ github.sha }}
- uses: actions/setup-go@v1
with:
go-version: 1.16
- uses: actions/checkout@v2
with:
ref: cat/fix/change-image
repository: catthehacker/act-fork
path: act
- env:
ACT_TEST_IMAGE: ghcr.io/${{ env.SLUG }}:act-${{ steps.print-tag.outputs.tag }}
ACT_REPOSITORY: catthehacker/act-fork
ACT_OWNER: catthehacker
run: |
cd act/
go test ./...
- name: Build and push ${{ env.SLUG }}:${{ env.TAG }}
uses: docker/build-push-action@v2
env:
TAG: act
with:
context: .
push: ${{ ( github.event_name != 'pull_request' && !env.ACT ) }}
file: ./linux/${{ env.IMAGE }}/act/Dockerfile
platforms: ${{ env.PLATFORMS }}
tags: |
ghcr.io/${{ env.SLUG }}:${{ env.TAG }}
quay.io/${{ env.SLUG }}:${{ env.TAG }}
docker.io/${{ env.SLUG }}:${{ env.TAG }}
build-args: |
IMAGEOS=${{ env.IMAGE }}
BUILD_TAG_VERSION=${{ steps.print-tag.outputs.tag }}
BUILD_TAG=${{ env.TAG }}
BUILD_REF=${{ github.sha }}
- name: Build and push ${{ env.SLUG }}:${{ env.TAG }}
uses: docker/build-push-action@v2
env:
TAG: runner
with:
context: .
push: ${{ ( github.event_name != 'pull_request' && !env.ACT ) }}
file: ./linux/${{ env.IMAGE }}/runner/Dockerfile
platforms: ${{ env.PLATFORMS }}
tags: |
ghcr.io/${{ env.SLUG }}:${{ env.TAG }}
quay.io/${{ env.SLUG }}:${{ env.TAG }}
docker.io/${{ env.SLUG }}:${{ env.TAG }}
build-args: |
IMAGE=ghcr.io/${{ env.SLUG }}
IMAGEOS=${{ env.IMAGE }}
TAG=act-${{ steps.print-tag.outputs.tag }}
BUILD_TAG_VERSION=${{ steps.print-tag.outputs.tag }}
BUILD_TAG=${{ env.TAG }}
BUILD_REF=${{ github.sha }}
+101 -48
View File
@@ -7,6 +7,8 @@ on:
paths: paths:
- '.github/workflows/build-ubuntu.yml' - '.github/workflows/build-ubuntu.yml'
- 'linux/ubuntu/**' - 'linux/ubuntu/**'
branches:
- 'master'
pull_request: pull_request:
paths: paths:
- '.github/workflows/build-ubuntu.yml' - '.github/workflows/build-ubuntu.yml'
@@ -14,24 +16,23 @@ on:
workflow_dispatch: workflow_dispatch:
env: env:
SLUG: ${{ github.repository_owner }}/ubuntu
IMAGE: ubuntu
PLATFORMS: linux/amd64,linux/arm64
NODE: '12' NODE: '12'
jobs: jobs:
build: build:
name: Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ ( github.actor == github.repository_owner && github.event_name != 'pull_request' ) || ( github.actor != github.repository_owner ) }} environment: Images
strategy: strategy:
fail-fast: true fail-fast: true
max-parallel: 4 max-parallel: 4
matrix: matrix:
BASEIMAGE: [ubuntu]
TAG: [latest, 20.04, 18.04, 16.04] TAG: [latest, 20.04, 18.04, 16.04]
IMAGE_TYPE: [act]
steps: steps:
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
id: ghcr id: ghcr
if: ${{ github.actor == github.repository_owner && !env.ACT }}
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
registry: ghcr.io registry: ghcr.io
@@ -40,7 +41,6 @@ jobs:
- name: Login to Quay - name: Login to Quay
id: quay id: quay
if: ${{ github.actor == github.repository_owner && !env.ACT }}
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
registry: quay.io registry: quay.io
@@ -49,18 +49,25 @@ jobs:
- name: Login to Docker Hub - name: Login to Docker Hub
id: dckr id: dckr
if: ${{ github.actor == github.repository_owner && !env.ACT }}
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
username: ${{ secrets.DOCKER_USER }} username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }} password: ${{ secrets.DOCKER_TOKEN }}
- name: Print date in UTC format - name: Print tag
id: print-date id: print-tag
run: echo "::set-output name=date::$(date +%Y%m%d)" shell: sh
run: |
if ${{ github.event_name == 'pull_request' }} && ${{ !env.ACT }} ; then
echo "::set-output name=tag::PR-${{ github.event.number }}"
elif ${{ !env.ACT }} ; then
echo "::set-output name=tag::$(date +%Y%m%d)"
else
echo "::set-output name=tag::dev"
fi
- name: Set Ubuntu version to RELEASE - name: Set Ubuntu version to RELEASE
id: release id: print-release
run: | run: |
if [ "latest" = "${{ matrix.TAG }}" ]; then if [ "latest" = "${{ matrix.TAG }}" ]; then
echo "::set-output name=RELEASE::$(lsb_release -rs)" echo "::set-output name=RELEASE::$(lsb_release -rs)"
@@ -76,56 +83,102 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Build and push ${{ github.repository_owner }}/${{ matrix.BASEIMAGE }}:act-${{ matrix.TAG }}-${{ steps.print-date.outputs.date }} - name: Build and push ${{ env.SLUG }}:${{ env.TAG }}
id: act
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
env: env:
GHCR_TAG: ghcr.io/${{ github.repository_owner }}/${{ matrix.BASEIMAGE }}:act-${{ matrix.TAG }} TAG: act-${{ matrix.TAG }}-${{ steps.print-tag.outputs.tag }}
QUAY_TAG: quay.io/${{ github.repository_owner }}/${{ matrix.BASEIMAGE }}:act-${{ matrix.TAG }}
DCKR_TAG: docker.io/${{ github.repository_owner }}/${{ matrix.BASEIMAGE }}:act-${{ matrix.TAG }}
with: with:
context: . context: .
push: ${{ github.event_name != 'pull_request' && github.event_name != 'push' && !env.ACT }} push: true
file: ./linux/${{ matrix.BASEIMAGE }}/act/Dockerfile file: ./linux/${{ env.IMAGE }}/act/Dockerfile
platforms: linux/amd64,linux/arm64 platforms: ${{ env.PLATFORMS }}
tags: | tags: |
${{ env.GHCR_TAG }} ghcr.io/${{ env.SLUG }}:${{ env.TAG }}
${{ env.GHCR_TAG }}-${{ steps.print-date.outputs.date }} quay.io/${{ env.SLUG }}:${{ env.TAG }}
${{ env.QUAY_TAG }} docker.io/${{ env.SLUG }}:${{ env.TAG }}
${{ env.QUAY_TAG }}-${{ steps.print-date.outputs.date }}
${{ env.DCKR_TAG }}
${{ env.DCKR_TAG }}-${{ steps.print-date.outputs.date }}
build-args: | build-args: |
BASEIMAGE=buildpack-deps IMAGEOS=${{ env.IMAGE }}
TAG=${{ steps.release.outputs.RELEASE }}
NODE_VERSION=${{ env.NODE }} NODE_VERSION=${{ env.NODE }}
BUILD_TAG_VERSION=${{ steps.print-date.outputs.date }} BUILD_TAG_VERSION=${{ steps.print-tag.outputs.tag }}
BUILD_TAG=act BUILD_TAG=act-${{ matrix.TAG }}
BUILD_REF=${{ github.sha }} BUILD_REF=${{ github.sha }}
- name: Build and push ${{ github.repository_owner }}/${{ matrix.BASEIMAGE }}:runner-${{ matrix.TAG }}-${{ steps.print-date.outputs.date }} - name: Build and push ${{ env.SLUG }}:${{ env.TAG }}
id: runner
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
if: ${{ github.event_name != 'pull_request' && github.event_name != 'push' && !env.ACT }}
env: env:
GHCR_TAG: ghcr.io/${{ github.repository_owner }}/${{ matrix.BASEIMAGE }}:runner-${{ matrix.TAG }} TAG: runner-${{ matrix.TAG }}-${{ steps.print-tag.outputs.tag }}
QUAY_TAG: quay.io/${{ github.repository_owner }}/${{ matrix.BASEIMAGE }}:runner-${{ matrix.TAG }}
DCKR_TAG: docker.io/${{ github.repository_owner }}/${{ matrix.BASEIMAGE }}:runner-${{ matrix.TAG }}
with: with:
context: . context: .
push: ${{ github.event_name != 'pull_request' && github.event_name != 'push' && !env.ACT }} push: true
file: ./linux/${{ matrix.BASEIMAGE }}/runner/Dockerfile file: ./linux/${{ env.IMAGE }}/runner/Dockerfile
platforms: linux/amd64,linux/arm64 platforms: ${{ env.PLATFORMS }}
tags: | tags: |
${{ env.GHCR_TAG }} ghcr.io/${{ env.SLUG }}:${{ env.TAG }}
${{ env.GHCR_TAG }}-${{ steps.print-date.outputs.date }} quay.io/${{ env.SLUG }}:${{ env.TAG }}
${{ env.QUAY_TAG }} docker.io/${{ env.SLUG }}:${{ env.TAG }}
${{ env.QUAY_TAG }}-${{ steps.print-date.outputs.date }}
${{ env.DCKR_TAG }}
${{ env.DCKR_TAG }}-${{ steps.print-date.outputs.date }}
build-args: | build-args: |
BASEIMAGE=catthehacker/ubuntu IMAGE=ghcr.io/${{ env.SLUG }}
TAG=act-${{ matrix.TAG }} IMAGEOS=${{ env.IMAGE }}
BUILD_TAG_VERSION=${{ steps.print-date.outputs.date }} TAG=act-${{ matrix.TAG }}-${{ steps.print-tag.outputs.tag }}
BUILD_TAG=${{ matrix.IMAGE_TYPE }} BUILD_TAG_VERSION=${{ steps.print-tag.outputs.tag }}
BUILD_TAG=runner
BUILD_REF=${{ github.sha }}
- uses: actions/setup-go@v1
with:
go-version: 1.16
- uses: actions/checkout@v2
with:
ref: cat/fix/change-image
repository: catthehacker/act-fork
path: act
- env:
ACT_TEST_IMAGE: ghcr.io/${{ env.SLUG }}:act-${{ matrix.TAG }}-${{ steps.print-tag.outputs.tag }}
ACT_REPOSITORY: catthehacker/act-fork
ACT_OWNER: catthehacker
run: |
cd act/
go test ./...
- name: Build and push ${{ env.SLUG }}:${{ env.TAG }}
uses: docker/build-push-action@v2
env:
TAG: act
with:
context: .
push: ${{ ( github.event_name != 'pull_request' && !env.ACT ) }}
file: ./linux/${{ env.IMAGE }}/act/Dockerfile
platforms: ${{ env.PLATFORMS }}
tags: |
ghcr.io/${{ env.SLUG }}:${{ env.TAG }}
quay.io/${{ env.SLUG }}:${{ env.TAG }}
docker.io/${{ env.SLUG }}:${{ env.TAG }}
build-args: |
NODE_VERSION=${{ env.NODE }}
IMAGEOS=${{ env.IMAGE }}
BUILD_TAG_VERSION=${{ steps.print-tag.outputs.tag }}
BUILD_TAG=act-${{ matrix.TAG }}
BUILD_REF=${{ github.sha }}
- name: Build and push ${{ env.SLUG }}:${{ env.TAG }}
uses: docker/build-push-action@v2
env:
TAG: runner
with:
context: .
push: ${{ ( github.event_name != 'pull_request' && !env.ACT ) }}
file: ./linux/${{ env.IMAGE }}/runner/Dockerfile
platforms: ${{ env.PLATFORMS }}
tags: |
ghcr.io/${{ env.SLUG }}:${{ env.TAG }}
quay.io/${{ env.SLUG }}:${{ env.TAG }}
docker.io/${{ env.SLUG }}:${{ env.TAG }}
build-args: |
IMAGE=ghcr.io/${{ env.SLUG }}
IMAGEOS=${{ env.IMAGE }}
TAG=act-${{ matrix.TAG }}-${{ steps.print-tag.outputs.tag }}
BUILD_TAG_VERSION=${{ steps.print-tag.outputs.tag }}
BUILD_TAG=runner-${{ matrix.TAG }}
BUILD_REF=${{ github.sha }} BUILD_REF=${{ github.sha }}
+3 -1
View File
@@ -2,6 +2,8 @@ name: Lint Code Base
on: on:
push: push:
branches:
- 'master'
pull_request: pull_request:
workflow_dispatch: workflow_dispatch:
@@ -15,7 +17,7 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Lint - name: Lint
uses: github/super-linter@v3 uses: nvuillam/mega-linter/flavors/documentation@v4
env: env:
VALIDATE_ALL_CODEBASE: ${{ github.event_name != 'pull_request' }} VALIDATE_ALL_CODEBASE: ${{ github.event_name != 'pull_request' }}
DEFAULT_BRANCH: master DEFAULT_BRANCH: master
+7
View File
@@ -1 +1,8 @@
build.ps1 build.ps1
# custom stuff
.secrets
.env
# mega-linter
report
+6
View File
@@ -0,0 +1,6 @@
---
DISABLE:
- COPYPASTE
DISABLE_LINTERS:
- SPELL_CSPELL
- DOCKERFILE_DOCKERFILELINT
+2
View File
@@ -0,0 +1,2 @@
---
singleQuote: true
+3 -2
View File
@@ -6,7 +6,7 @@
## When updates will be applied to images ## When updates will be applied to images
- A package that will be required for action(s) to work properly might be added/removed/changed - A package that will be required for action(s) to work properly might be added/removed/changed
- Any maintainance that will be required due to: - Any maintenance that will be required due to:
- Docker Hub - Docker Hub
- Quay - Quay
- GitHub Container Registry - GitHub Container Registry
@@ -34,6 +34,7 @@
- [`/linux/alpine/act/`](./linux/alpine/act/) - Alpine base image for `act` - [`/linux/alpine/act/`](./linux/alpine/act/) - Alpine base image for `act`
- docker.io (DockerHub) - docker.io (DockerHub)
- `catthehacker/alpine:act` - `catthehacker/alpine:act`
- `catthehacker/alpine:runner`
[actions/virtual-environments]: https://github.com/actions/virtual-environments [actions/virtual-environments]: https://github.com/actions/virtual-environments
[catthehacker/runner-image]: https://github.com/catthehacker/runner-image [catthehacker/runner-image]: https://github.com/catthehacker/virtual-environments
+68
View File
@@ -0,0 +1,68 @@
ARG IMAGE=alpine
ARG TAG=3.13
FROM ${IMAGE}:${TAG}
# > automatic buildx ARGs
ARG TARGETARCH
ARG TARGETVARIANT
# > ARGs before FROM are not accessible
ARG IMAGE=alpine
ARG TAG=3.13
ARG IMAGEOS=alpine
SHELL [ "/bin/ash", "-l", "-o", "pipefail", "-c" ]
# > setup environment required for GitHub Actions, install dependencies/packages
RUN set -euxo pipefail \
&& printf "\n\n\t🐋\t Build started \t🐋\t\n\n" \
&& printf "\n\n\t🐋\t Adding environment variables \t🐋\t\n\n" \
&& echo "USER=$(whoami)" | tee -a /etc/environment \
&& echo "RUNNER_USER=$(whoami)" | tee -a /etc/environment \
&& echo "IMAGE_OS=${IMAGE}" | tee -a /etc/environment \
&& echo "ImageOS=${IMAGE}" | tee -a /etc/environment \
#&& echo "LSB_RELEASE=${DISTRIB_RELEASE}" | tee -a /etc/environment \
&& AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache \
&& echo "AGENT_TOOLSDIRECTORY=${AGENT_TOOLSDIRECTORY}" | tee -a /etc/environment \
&& echo "RUN_TOOL_CACHE=${AGENT_TOOLSDIRECTORY}" | tee -a /etc/environment \
&& echo "DEPLOYMENT_BASEPATH=/opt/runner" | tee -a /etc/environment \
&& echo ". /etc/environment" | tee -a /etc/profile \
&& printf "\n\n\t🐋\t Creating tool cache directory and '/github' \t🐋\t\n\n" \
&& mkdir -p ${AGENT_TOOLSDIRECTORY} \
&& chown 1000:1000 ${AGENT_TOOLSDIRECTORY} \
&& chmod 0777 ${AGENT_TOOLSDIRECTORY} \
&& mkdir -p /github \
&& chown 1000:1000 /github \
&& chmod 0777 /github \
&& printf "\n\n\t🐋\t Installing packages \t🐋\t\n\n" \
&& apk --no-cache add bash openssh-client gawk jq curl git wget sudo gnupg ca-certificates yaml zstd zip unzip xz icu build-base python3 nodejs docker-cli \
&& ln -s $(which python3) /usr/local/bin/python \
&& printf "\n\n\t🐋\t Docker: $(docker -v) \t🐋\t\n\n" \
&& printf "\n\n\t🐋\t Node: $(node -v) \t🐋\t\n\n" \
&& apk list -I | sort \
&& printf "\n\n\t🐋\t Creating ~/.ssh and adding 'github.com' \t🐋\t\n\n" \
&& mkdir -p ~/.ssh \
&& chmod 700 ~/.ssh \
&& ssh-keyscan github.com | tee ~/.ssh/known_hosts \
&& printf "\n\n\t🐋\t Installed base utils \t🐋\t\n\n" \
&& sed -i /etc/sudoers -re 's/^%sudo.*/%sudo ALL=(ALL:ALL) NOPASSWD: ALL/g' \
&& sed -i /etc/sudoers -re 's/^root.*/root ALL=(ALL:ALL) NOPASSWD: ALL/g' \
&& sed -i /etc/sudoers -re 's/^#includedir.*/## **Removed the include directive** ##"/g' \
&& printf "\n\n\t🐋\t Cleaning image \t🐋\t\n\n" \
&& apk clean cache \
&& rm -rf /var/cache/* /var/log/* /tmp/* || echo 'Failed to delete directories' \
&& printf "\n\n\t🐋\t Cleaned up image \t🐋\t\n\n"
ARG BUILD_TAG_VERSION="dev"
ARG BUILD_TAG="act"
ARG BUILD_REF="master"
LABEL org.opencontainers.image.vendor="catthehacker"
LABEL org.opencontainers.image.authors="me@hackerc.at"
LABEL org.opencontainers.image.url="https://github.com/catthehacker/docker_images/tree/${BUILD_REF}/linux/${IMAGEOS}/${BUILD_TAG}/"
LABEL org.opencontainers.image.source="https://github.com/catthehacker/docker_images"
LABEL org.opencontainers.image.version=${BUILD_TAG_VERSION}
LABEL org.opencontainers.image.title=${BUILD_TAG}-${TARGETARCH}-${TARGETVARIANT}
LABEL org.opencontainers.image.revision=${BUILD_REF}
USER root
-65
View File
@@ -1,65 +0,0 @@
ARG BASEIMAGE=node
ARG TAG=lts-alpine3.13
FROM ${BASEIMAGE}:${TAG}
ARG TARGETARCH
ARG TARGETVARIANT
# > ARGs before FROM are not accessible
ARG BASEIMAGE=alpine
ARG TAG=3.13
ARG AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
ARG IMAGE_TYPE=act
ENV ImageOS=alpine
SHELL [ "/bin/ash", "-o", "pipefail", "-l", "-c" ]
# > setup environment required for GitHub Actions, install dependencies/packages
RUN set -euxo pipefail \
&& printf "Build started\nAdding environment variables\n\n" \
&& echo "USER=$(whoami)" | tee -a /etc/environment \
&& echo "RUNNER_USER=$(whoami)" | tee -a /etc/environment \
&& echo "IMAGE_OS=${ImageOS}" | tee -a /etc/environment \
&& echo "ImageOS=${ImageOS}" | tee -a /etc/environment \
#&& echo "LSB_RELEASE=${DISTRIB_RELEASE}" | tee -a /etc/environment \
&& echo "AGENT_TOOLSDIRECTORY=${AGENT_TOOLSDIRECTORY}" | tee -a /etc/environment \
&& echo "RUN_TOOL_CACHE=${AGENT_TOOLSDIRECTORY}" | tee -a /etc/environment \
&& echo "DEPLOYMENT_BASEPATH=/opt/runner" | tee -a /etc/environment \
&& echo ". /etc/environment" | tee -a /etc/profile \
&& printf "Creating tool cache directory and '/github'\n\n" \
&& mkdir -p ${AGENT_TOOLSDIRECTORY} \
&& chown 1000:1000 ${AGENT_TOOLSDIRECTORY} \
&& chmod 0777 ${AGENT_TOOLSDIRECTORY} \
&& mkdir -p /github \
&& chown 1000:1000 /github \
&& chmod 0777 /github \
&& printf "Installing packages\n\n" \
&& apk --no-cache add openssh-client gawk jq curl git wget sudo gnupg ca-certificates yaml zstd zip unzip xz icu build-base python3 \
&& printf "Creating ~/.ssh and adding 'github.com'\n\n" \
&& mkdir -p ~/.ssh \
&& chmod 700 ~/.ssh \
&& ssh-keyscan github.com | tee ~/.ssh/known_hosts \
&& printf "Installed base utils\nInstalling docker\n" \
&& apk --no-cache add docker-cli \
&& printf "Cleaning image\n" \
&& apk clean cache \
&& rm -rf /var/cache/* /var/log/* /tmp/* || echo 'Failed to delete directories' \
&& printf "Cleaned up image\n"
ARG BUILD_TAG_VERSION="master"
ARG BUILD_TAG=${IMAGE_TYPE}
ARG BUILD_REF="master"
LABEL org.opencontainers.image.vendor="catthehacker"
LABEL org.opencontainers.image.authors="me@hackerc.at"
LABEL org.opencontainers.image.url="https://github.com/catthehacker/docker_images/tree/${BUILD_REF}/linux/${ImageOS}/${BUILD_TAG}/"
LABEL org.opencontainers.image.source="https://github.com/catthehacker/docker_images.git"
LABEL org.opencontainers.image.version=${BUILD_TAG_VERSION}
LABEL org.opencontainers.image.title=${BUILD_TAG}-${TARGETARCH}-${TARGETVARIANT}
LABEL org.opencontainers.image.revision=${BUILD_REF}
SHELL [ "/bin/ash", "-l", "-c" ]
# > Force bash with environment
ENTRYPOINT [ "/bin/ash", "-l", "-c" ]
@@ -1,21 +1,24 @@
ARG BASEIMAGE=catthehacker/alpine ARG IMAGE=ghcr.io/catthehacker/alpine
ARG TAG=act ARG TAG=act
FROM ${BASEIMAGE}:${TAG} FROM ${IMAGE}:${TAG}
SHELL [ "/bin/ash", "-o", "pipefail", "-l", "-c" ] ARG TARGETARCH
ARG TARGETVARIANT
RUN set -Eeuxo pipefail \ SHELL [ "/bin/ash", "-l", "-o", "pipefail", "-c" ]
RUN set -euxo pipefail \
&& printf "Installing Go(lang)\n" \ && printf "Installing Go(lang)\n" \
&& sudo apk add --no-cache go && sudo apk add --no-cache go
ARG BUILD_TAG_VERSION="master" ARG BUILD_TAG_VERSION="dev"
ARG BUILD_TAG="go" ARG BUILD_TAG="go"
ARG BUILD_REF="master" ARG BUILD_REF="master"
LABEL org.opencontainers.image.vendor="catthehacker" LABEL org.opencontainers.image.vendor="catthehacker"
LABEL org.opencontainers.image.authors="me@hackerc.at" LABEL org.opencontainers.image.authors="me@hackerc.at"
LABEL org.opencontainers.image.url="https://github.com/catthehacker/docker_images/tree/${BUILD_REF}/linux/${ImageOS}/${BUILD_TAG}/" LABEL org.opencontainers.image.url="https://github.com/catthehacker/docker_images/tree/${BUILD_REF}/linux/${ImageOS}/${BUILD_TAG}/"
LABEL org.opencontainers.image.source="https://github.com/catthehacker/docker_images.git" LABEL org.opencontainers.image.source="https://github.com/catthehacker/docker_images"
LABEL org.opencontainers.image.version=${BUILD_TAG_VERSION} LABEL org.opencontainers.image.version=${BUILD_TAG_VERSION}
LABEL org.opencontainers.image.title=${BUILD_TAG}-${TARGETARCH}-${TARGETVARIANT} LABEL org.opencontainers.image.title=${BUILD_TAG}-${TARGETARCH}-${TARGETVARIANT}
LABEL org.opencontainers.image.revision=${BUILD_REF} LABEL org.opencontainers.image.revision=${BUILD_REF}
@@ -1,8 +1,11 @@
ARG BASEIMAGE=catthehacker/alpine ARG IMAGE=ghcr.io/catthehacker/alpine
ARG TAG=act ARG TAG=act
FROM ${BASEIMAGE}:${TAG} FROM ${IMAGE}:${TAG}
SHELL [ "/bin/ash", "-o", "pipefail", "-l", "-c" ] ARG TARGETARCH
ARG TARGETVARIANT
SHELL [ "/bin/ash", "-l", "-o", "pipefail", "-c" ]
ARG RUNNER=runner ARG RUNNER=runner
@@ -26,14 +29,11 @@ RUN set -euxo pipefail \
&& chmod 644 "/home/${RUNNER}/.ssh/known_hosts" \ && chmod 644 "/home/${RUNNER}/.ssh/known_hosts" \
&& chown -R ${RUNNER}:${RUNNER} "/home/${RUNNER}/.ssh" && chown -R ${RUNNER}:${RUNNER} "/home/${RUNNER}/.ssh"
ARG BUILD_TAG_VERSION="master" ARG BUILD_TAG_VERSION="dev"
ARG BUILD_TAG="runner" ARG BUILD_TAG="runner"
ARG BUILD_REF="master" ARG BUILD_REF="master"
LABEL org.opencontainers.image.vendor="catthehacker"
LABEL org.opencontainers.image.authors="me@hackerc.at"
LABEL org.opencontainers.image.url="https://github.com/catthehacker/docker_images/tree/${BUILD_REF}/linux/${ImageOS}/${BUILD_TAG}/" LABEL org.opencontainers.image.url="https://github.com/catthehacker/docker_images/tree/${BUILD_REF}/linux/${ImageOS}/${BUILD_TAG}/"
LABEL org.opencontainers.image.source="https://github.com/catthehacker/docker_images.git"
LABEL org.opencontainers.image.version=${BUILD_TAG_VERSION} LABEL org.opencontainers.image.version=${BUILD_TAG_VERSION}
LABEL org.opencontainers.image.title=${BUILD_TAG}-${TARGETARCH}-${TARGETVARIANT} LABEL org.opencontainers.image.title=${BUILD_TAG}-${TARGETARCH}-${TARGETVARIANT}
LABEL org.opencontainers.image.revision=${BUILD_REF} LABEL org.opencontainers.image.revision=${BUILD_REF}
@@ -1,21 +1,21 @@
ARG BASEIMAGE=catthehacker/alpine ARG IMAGE=ghcr.io/catthehacker/alpine
ARG TAG=act ARG TAG=act
FROM ${BASEIMAGE}:${TAG} FROM ${IMAGE}:${TAG}
SHELL [ "/bin/ash", "-o", "pipefail", "-l", "-c" ] ARG TARGETARCH
ARG TARGETVARIANT
RUN set -Eeuxo pipefail \ SHELL [ "/bin/ash", "-l", "-o", "pipefail", "-c" ]
RUN set -euxo pipefail \
&& printf "Installing Rust\n" \ && printf "Installing Rust\n" \
&& curl https://sh.rustup.rs -sSf | sh -s -- -y && curl https://sh.rustup.rs -sSf | sh -s -- -y
ARG BUILD_TAG_VERSION="master" ARG BUILD_TAG_VERSION="dev"
ARG BUILD_TAG="rust" ARG BUILD_TAG="rust"
ARG BUILD_REF="master" ARG BUILD_REF="master"
LABEL org.opencontainers.image.vendor="catthehacker"
LABEL org.opencontainers.image.authors="me@hackerc.at"
LABEL org.opencontainers.image.url="https://github.com/catthehacker/docker_images/tree/${BUILD_REF}/linux/${ImageOS}/${BUILD_TAG}/" LABEL org.opencontainers.image.url="https://github.com/catthehacker/docker_images/tree/${BUILD_REF}/linux/${ImageOS}/${BUILD_TAG}/"
LABEL org.opencontainers.image.source="https://github.com/catthehacker/docker_images.git"
LABEL org.opencontainers.image.version=${BUILD_TAG_VERSION} LABEL org.opencontainers.image.version=${BUILD_TAG_VERSION}
LABEL org.opencontainers.image.title=${BUILD_TAG}-${TARGETARCH}-${TARGETVARIANT} LABEL org.opencontainers.image.title=${BUILD_TAG}-${TARGETARCH}-${TARGETVARIANT}
LABEL org.opencontainers.image.revision=${BUILD_REF} LABEL org.opencontainers.image.revision=${BUILD_REF}
+24 -18
View File
@@ -1,22 +1,26 @@
ARG BASEIMAGE=buildpack-deps ARG IMAGE=buildpack-deps
ARG TAG=20.04 ARG TAG=20.04
FROM ${BASEIMAGE}:${TAG} FROM ${IMAGE}:${TAG}
# > automatic buildx ARGs
ARG TARGETARCH
ARG TARGETVARIANT
# > ARGs before FROM are not accessible # > ARGs before FROM are not accessible
ARG BASEIMAGE=buildpack-deps ARG IMAGE=buildpack-deps
ARG TAG=20.04 ARG TAG=20.04
# > Node version # > NodeJS version
ARG NODE_VERSION=12 ARG NODE_VERSION=12
# > Force apt to not be interactive/not ask # > Force apt to not be interactive/not ask
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive
SHELL [ "/bin/bash", "--login", "-o", "pipefail", "-c" ] SHELL [ "/bin/bash", "--noprofile", "--norc", "-e", "-o", "pipefail", "-c" ]
# > setup environment required for GitHub Actions # > setup environment required for GitHub Actions
RUN set -Eeuxo pipefail \ RUN set -Eeuxo pipefail \
&& printf "Build started\n" \ && printf "\n\n\t🐋\t Build started \t🐋\t\n\n" \
&& echo "USER=$(whoami)" | tee -a /etc/environment \ && echo "USER=$(whoami)" | tee -a /etc/environment \
&& echo "RUNNER_USER=$(whoami)" | tee -a /etc/environment \ && echo "RUNNER_USER=$(whoami)" | tee -a /etc/environment \
&& ImageOS=ubuntu$(echo ${TAG} | cut -d'.' -f 1) \ && ImageOS=ubuntu$(echo ${TAG} | cut -d'.' -f 1) \
@@ -34,44 +38,46 @@ RUN set -Eeuxo pipefail \
&& mkdir -p /github \ && mkdir -p /github \
&& chown 1000:1000 /github \ && chown 1000:1000 /github \
&& chmod 0777 /github \ && chmod 0777 /github \
&& printf "Installing packages\n\n" \ && printf "\n\n\t🐋\t Installing packages \t🐋\t\n\n" \
&& apt-get -yq update \ && apt-get -yq update \
&& printf "Updated apt lists and upgraded packages\n\n" \
&& apt-get -yq install --no-install-recommends ssh lsb-release gawk jq curl git wget sudo gnupg-agent ca-certificates software-properties-common apt-transport-https libyaml-0-2 zstd unzip xz-utils "$(apt-cache search libicu | grep -E 'libicu[[:digit:]]+ -' | cut -d \" \" -f 1)" \ && apt-get -yq install --no-install-recommends ssh lsb-release gawk jq curl git wget sudo gnupg-agent ca-certificates software-properties-common apt-transport-https libyaml-0-2 zstd unzip xz-utils "$(apt-cache search libicu | grep -E 'libicu[[:digit:]]+ -' | cut -d \" \" -f 1)" \
&& ln -s $(which python3) /usr/local/bin/python \
&& [[ "${TAG}" == "16.04" ]] && printf 'git-lfs not available for Xenial' || apt-get -yq install --no-install-recommends git-lfs \ && [[ "${TAG}" == "16.04" ]] && printf 'git-lfs not available for Xenial' || apt-get -yq install --no-install-recommends git-lfs \
&& printf "Creating ~/.ssh and adding 'github.com'\n\n" \ && printf "\n\n\t🐋\t Updated apt lists and upgraded packages \t🐋\t\n\n" \
&& printf "\n\n\t🐋\t Creating ~/.ssh and adding 'github.com' \t🐋\t\n\n" \
&& mkdir -p ~/.ssh \ && mkdir -p ~/.ssh \
&& chmod 700 ~/.ssh \ && chmod 700 ~/.ssh \
&& ssh-keyscan github.com | tee ~/.ssh/known_hosts \ && ssh-keyscan github.com | tee ~/.ssh/known_hosts \
&& printf "Installed base utils\nInstalling docker\n" \ && printf "\n\n\t🐋\t Installed base utils\nInstalling docker \t🐋\t\n\n" \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \ && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
&& add-apt-repository "deb https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \ && add-apt-repository "deb https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
&& apt-get -yq update \ && apt-get -yq update \
&& apt-get -yq install --no-install-recommends docker-ce-cli \ && apt-get -yq install --no-install-recommends docker-ce-cli \
&& printf "Installing Node.JS\n" \ && printf "\n\n\t🐋\t Installed $(docker -v)\n \t🐋\t\n\n" \
&& printf "\n\n\t🐋\t Installing Node.JS \t🐋\t\n\n" \
&& curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ && curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
&& DISTRO="$(lsb_release -s -c)" \ && DISTRO="$(lsb_release -s -c)" \
&& echo "deb https://deb.nodesource.com/node_${NODE_VERSION}.x $DISTRO main" | tee /etc/apt/sources.list.d/nodesource.list \ && echo "deb https://deb.nodesource.com/node_${NODE_VERSION}.x $DISTRO main" | tee /etc/apt/sources.list.d/nodesource.list \
&& echo "deb-src https://deb.nodesource.com/node_${NODE_VERSION}.x $DISTRO main" | tee -a /etc/apt/sources.list.d/nodesource.list \ && echo "deb-src https://deb.nodesource.com/node_${NODE_VERSION}.x $DISTRO main" | tee -a /etc/apt/sources.list.d/nodesource.list \
&& apt-get -yq update \ && apt-get -yq update \
&& apt-get -yq install --no-install-recommends nodejs="${NODE_VERSION}*" \ && apt-get -yq install --no-install-recommends nodejs="${NODE_VERSION}*" \
&& printf "Installed Node.JS $(node -v)\n" \ && printf "\n\n\t🐋\t Installed Node.JS $(node -v) \t🐋\t\n\n" \
&& dpkg-query -f '${binary:Package}\n' -W \ && dpkg-query -f '${binary:Package}\n' -W \
&& printf "Cleaning image\n" \ && printf "\n\n\t🐋\t Cleaning image \t🐋\t\n\n" \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/cache/* /var/log/* /var/lib/apt/lists/* /tmp/* || echo 'Failed to delete directories' \ && rm -rf /var/cache/* /var/log/* /var/lib/apt/lists/* /tmp/* || echo 'Failed to delete directories' \
&& printf "Cleaned up image\n" && printf "\n\n\t🐋\t Cleaned up image \t🐋\t\n\n"
ARG BUILD_TAG_VERSION="master" ARG BUILD_TAG_VERSION="dev"
ARG BUILD_TAG="act" ARG BUILD_TAG="act"
ARG BUILD_REF="master" ARG BUILD_REF="master"
LABEL org.opencontainers.image.vendor="catthehacker" LABEL org.opencontainers.image.vendor="catthehacker"
LABEL org.opencontainers.image.authors="me@hackerc.at" LABEL org.opencontainers.image.authors="me@hackerc.at"
LABEL org.opencontainers.image.url="https://github.com/catthehacker/docker_images" LABEL org.opencontainers.image.url="https://github.com/catthehacker/docker_images/tree/${BUILD_REF}/linux/${IMAGE}/${BUILD_TAG}/"
LABEL org.opencontainers.image.source="https://github.com/catthehacker/docker_images.git" LABEL org.opencontainers.image.source="https://github.com/catthehacker/docker_images"
LABEL org.opencontainers.image.version=${BUILD_TAG_VERSION} LABEL org.opencontainers.image.version=${BUILD_TAG_VERSION}
LABEL org.opencontainers.image.title=${BUILD_TAG} LABEL org.opencontainers.image.title=${BUILD_TAG}-${TARGETARCH}-${TARGETVARIANT}
LABEL org.opencontainers.image.revision=${BUILD_REF} LABEL org.opencontainers.image.revision=${BUILD_REF}
USER root USER root
+21
View File
@@ -0,0 +1,21 @@
ARG IMAGE=ghcr.io/catthehacker/alpine
ARG TAG=act-latest
FROM ${IMAGE}:${TAG}
ARG TARGETARCH
ARG TARGETVARIANT
SHELL [ "/bin/bash", "--noprofile", "--norc", "-e", "-o", "pipefail", "-c" ]
RUN set -Eeuxo pipefail \
&& printf "Installing Go(lang)\n" \
&& sudo apk add --no-cache go
ARG BUILD_TAG_VERSION="dev"
ARG BUILD_TAG="go"
ARG BUILD_REF="master"
LABEL org.opencontainers.image.url="https://github.com/catthehacker/docker_images/tree/${BUILD_REF}/linux/${ImageOS}/${BUILD_TAG}/"
LABEL org.opencontainers.image.version=${BUILD_TAG_VERSION}
LABEL org.opencontainers.image.title=${BUILD_TAG}-${TARGETARCH}-${TARGETVARIANT}
LABEL org.opencontainers.image.revision=${BUILD_REF}
+32
View File
@@ -0,0 +1,32 @@
ARG IMAGE=ghcr.io/catthehacker/ubuntu
ARG TAG=act-latest
FROM ${IMAGE}:${TAG}
ARG TARGETARCH
ARG TARGETVARIANT
SHELL [ "/bin/bash", "--noprofile", "--norc", "-e", "-o", "pipefail", "-c" ]
RUN set -Eeuxo pipefail \
&& printf "\n\n\t🐋\t Installing JS tools \t🐋\t\n\n" \
&& printf "\n\n\t🐋\t Installed NPM $(npm -v) \t🐋\t\n\n" \
&& npm install -g npm \
&& npm install -g pnpm \
&& npm install -g yarn \
&& printf "\n\n\t🐋\t Installed NPM $(npm -v) \t🐋\t\n\n" \
&& printf "\n\n\t🐋\t Installed PNPM $(pnpm -v) \t🐋\t\n\n" \
&& printf "\n\n\t🐋\t Installed YARN $(yarn -v) \t🐋\t\n\n" \
&& npm install -g grunt gulp n parcel-bundler typescript newman vercel webpack webpack-cli lerna \
&& npm install -g --unsafe-perm netlify-cli \
&& printf "\n\n\t🐋\t Cleaning image \t🐋\t\n\n" \
&& apt-get clean \
&& rm -rf /var/cache/* /var/log/* /var/lib/apt/lists/* /tmp/* || echo 'Failed to delete directories' \
&& printf "\n\n\t🐋\t Cleaned up image \t🐋\t\n\n"
ARG BUILD_TAG_VERSION="dev"
ARG BUILD_TAG="rust"
ARG BUILD_REF="master"
LABEL org.opencontainers.image.url="https://github.com/catthehacker/docker_images/tree/${BUILD_REF}/linux/${ImageOS}/${BUILD_TAG}/"
LABEL org.opencontainers.image.version=${BUILD_TAG_VERSION}
LABEL org.opencontainers.image.title=${BUILD_TAG}-${TARGETARCH}-${TARGETVARIANT}
LABEL org.opencontainers.image.revision=${BUILD_REF}
+19
View File
@@ -0,0 +1,19 @@
ARG IMAGE=ghcr.io/catthehacker/alpine
ARG TAG=act-latest
FROM ${IMAGE}:${TAG}
ARG TARGETARCH
ARG TARGETVARIANT
SHELL [ "/bin/bash", "--noprofile", "--norc", "-e", "-o", "pipefail", "-c" ]
RUN #TODO
ARG BUILD_TAG_VERSION="dev"
ARG BUILD_TAG="rust"
ARG BUILD_REF="master"
LABEL org.opencontainers.image.url="https://github.com/catthehacker/docker_images/tree/${BUILD_REF}/linux/${ImageOS}/${BUILD_TAG}/"
LABEL org.opencontainers.image.version=${BUILD_TAG_VERSION}
LABEL org.opencontainers.image.title=${BUILD_TAG}-${TARGETARCH}-${TARGETVARIANT}
LABEL org.opencontainers.image.revision=${BUILD_REF}
+15 -17
View File
@@ -1,27 +1,27 @@
ARG BASEIMAGE=catthehacker/ubuntu ARG IMAGE=ghcr.io/catthehacker/ubuntu
ARG TAG=act-latest ARG TAG=act-latest
FROM ${BASEIMAGE}:${TAG} FROM ${IMAGE}:${TAG}
ARG TARGETARCH
ARG TARGETVARIANT
# > ARGs before FROM are not accessible # > ARGs before FROM are not accessible
ARG BASEIMAGE=catthehacker/ubuntu ARG IMAGE=catthehacker/ubuntu
ARG TAG=act-latest ARG TAG=act-latest
# > non-root user # > non-root user
ARG RUNNER=runner ARG RUNNER=runner
SHELL [ "/bin/bash", "--login", "-o", "pipefail", "-c" ] SHELL [ "/bin/bash", "--noprofile", "--norc", "-e", "-o", "pipefail", "-c" ]
# > Create non-root user # > Create non-root user
RUN set -Eeuxo pipefail \ RUN set -Eeuxo pipefail \
&& printf "Creating non-root user\n" \ && printf "\n\n\t🐋\t Creating non-root user \t🐋\t\n\n" \
&& groupadd -g 1000 ${RUNNER} \ && groupadd -g 1000 ${RUNNER} \
&& useradd -u 1000 -g ${RUNNER} -G sudo -m -s /bin/bash ${RUNNER} \ && useradd -u 1000 -g ${RUNNER} -G sudo -m -s /bin/bash ${RUNNER} \
&& sed -i /etc/sudoers -re 's/^%sudo.*/%sudo ALL=(ALL:ALL) NOPASSWD: ALL/g' \
&& sed -i /etc/sudoers -re 's/^root.*/root ALL=(ALL:ALL) NOPASSWD: ALL/g' \
&& sed -i /etc/sudoers -re 's/^#includedir.*/## **Removed the include directive** ##"/g' \
&& echo "${RUNNER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \ && echo "${RUNNER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \
&& printf "Runner user: $(su - ${RUNNER} -c id)\n" \ && printf "\n\n\t🐋\t Runner user: $(su - ${RUNNER} -c id) \t🐋\t\n\n" \
&& printf "Created non-root user $(grep ${RUNNER} /etc/passwd)\n" \ && printf "\n\n\t🐋\t Created non-root user $(grep ${RUNNER} /etc/passwd) \t🐋\t\n\n" \
&& sed -i /etc/environment -e "s/USER=root/USER=${RUNNER}/g" \ && sed -i /etc/environment -e "s/USER=root/USER=${RUNNER}/g" \
&& echo "RUNNER_TEMP=/home/${RUNNER}/work/_temp" | tee -a /etc/environment \ && echo "RUNNER_TEMP=/home/${RUNNER}/work/_temp" | tee -a /etc/environment \
&& mkdir -p "/home/${RUNNER}/work/_temp" \ && mkdir -p "/home/${RUNNER}/work/_temp" \
@@ -30,18 +30,16 @@ RUN set -Eeuxo pipefail \
&& chmod 700 "/home/${RUNNER}/.ssh" \ && chmod 700 "/home/${RUNNER}/.ssh" \
&& ssh-keyscan github.com | tee "/home/${RUNNER}/.ssh/known_hosts" \ && ssh-keyscan github.com | tee "/home/${RUNNER}/.ssh/known_hosts" \
&& chmod 644 "/home/${RUNNER}/.ssh/known_hosts" \ && chmod 644 "/home/${RUNNER}/.ssh/known_hosts" \
&& chown -R ${RUNNER}:${RUNNER} "/home/${RUNNER}/.ssh" && chown -R ${RUNNER}:${RUNNER} "/home/${RUNNER}/.ssh" \
&& printf "\n\n\t🐋\t Finished building \t🐋\t\n\n"
ARG BUILD_TAG_VERSION="master" ARG BUILD_TAG_VERSION="dev"
ARG BUILD_TAG="runner" ARG BUILD_TAG="runner"
ARG BUILD_REF="master" ARG BUILD_REF="master"
LABEL org.opencontainers.image.vendor="catthehacker" LABEL org.opencontainers.image.url="https://github.com/catthehacker/docker_images/tree/${BUILD_REF}/linux/${ImageOS}/${BUILD_TAG}/"
LABEL org.opencontainers.image.authors="me@hackerc.at"
LABEL org.opencontainers.image.url="https://github.com/catthehacker/docker_images/linux/${BASEIMAGE}/${IMAGE_TYPE}"
LABEL org.opencontainers.image.source="https://github.com/catthehacker/docker_images.git"
LABEL org.opencontainers.image.version=${BUILD_TAG_VERSION} LABEL org.opencontainers.image.version=${BUILD_TAG_VERSION}
LABEL org.opencontainers.image.title=${BUILD_TAG} LABEL org.opencontainers.image.title=${BUILD_TAG}-${TARGETARCH}-${TARGETVARIANT}
LABEL org.opencontainers.image.revision=${BUILD_REF} LABEL org.opencontainers.image.revision=${BUILD_REF}
USER ${RUNNER} USER ${RUNNER}
+20
View File
@@ -0,0 +1,20 @@
ARG IMAGE=ghcr.io/catthehacker/alpine
ARG TAG=act-latest
FROM ${IMAGE}:${TAG}
ARG TARGETARCH
ARG TARGETVARIANT
SHELL [ "/bin/bash", "--noprofile", "--norc", "-e", "-o", "pipefail", "-c" ]
RUN set -euxo pipefail \
&& printf "Installing Rust\n" \
&& curl https://sh.rustup.rs -sSf | sh -s -- -y
ARG BUILD_TAG_VERSION="dev"
ARG BUILD_TAG="rust"
ARG BUILD_REF="master"
LABEL org.opencontainers.image.url="https://github.com/catthehacker/docker_images/tree/${BUILD_REF}/linux/${ImageOS}/${BUILD_TAG}/"
LABEL org.opencontainers.image.version=${BUILD_TAG_VERSION}
LABEL org.opencontainers.image.title=${BUILD_TAG}-${TARGETARCH}-${TARGETVARIANT}
LABEL org.opencontainers.image.revision=${BUILD_REF}