Skip to content

Commit a345cab

Browse files
committed
Add docker images
1 parent 15c6e2a commit a345cab

4 files changed

Lines changed: 111 additions & 1 deletion

File tree

.github/dependabot.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,10 @@ updates:
2323
update-types:
2424
- minor
2525
- patch
26-
dependency-type: production
26+
dependency-type: production
27+
28+
- package-ecosystem: "docker"
29+
directory: "/"
30+
labels: []
31+
schedule:
32+
interval: "weekly"

.github/workflows/dock.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on:
2+
push:
3+
4+
jobs:
5+
build:
6+
name: Build & Push Docker Image
7+
runs-on: ubuntu-latest
8+
9+
permissions:
10+
contents: read
11+
packages: write
12+
13+
steps:
14+
- uses: docker/setup-buildx-action@v4
15+
16+
- uses: docker/login-action@v4
17+
with:
18+
registry: ghcr.io
19+
username: ${{ github.actor }}
20+
password: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- uses: actions/checkout@v6
23+
24+
- id: version
25+
run: |
26+
TAG=v0.1.2
27+
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
28+
echo "version=$(echo -n "$TAG" | cut -c '2-')" >> "$GITHUB_OUTPUT"
29+
30+
- uses: docker/build-push-action@v7
31+
with:
32+
tags: ghcr.io/n-e/actions-oidc-trigger:${{ steps.version.outputs.version }}-slim
33+
push: false
34+
target: slim
35+
cache-from: type=gha
36+
cache-to: type=gha,mode=max
37+
build-args: |
38+
TAG=${{ steps.version.outputs.tag }}
39+
40+
- uses: docker/build-push-action@v7
41+
with:
42+
tags: ghcr.io/n-e/actions-oidc-trigger:${{ steps.version.outputs.version }}-docker-cli
43+
push: false
44+
target: docker-cli
45+
cache-from: type=gha
46+
cache-to: type=gha,mode=max
47+
build-args: |
48+
TAG=${{ steps.version.outputs.tag }}
49+

Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
FROM node:24.14.0-trixie-slim AS base
2+
3+
ARG TAG
4+
5+
RUN npm i -g actions-oidc-trigger@$(echo -n "$TAG" | cut -c '2-')
6+
7+
8+
FROM base AS slim
9+
10+
RUN groupadd app && useradd app -g app -m
11+
12+
USER app
13+
14+
CMD [ "actions-oidc-trigger" ]
15+
16+
FROM base AS docker-cli
17+
18+
# In this image we don't switch to the app user as we need to be root to access the docker socket
19+
20+
COPY docker/add-docker-to-apt.sh ./
21+
22+
RUN ./add-docker-to-apt.sh && rm add-docker-to-apt.sh
23+
24+
# apt list --all-versions docker-ce
25+
ARG VERSION_STRING=5:29.2.1-1~debian.13~trixie
26+
27+
RUN apt update \
28+
&& apt install -y \
29+
docker-ce-cli=$VERSION_STRING \
30+
git \
31+
&& rm -rf /var/lib/apt/lists/*
32+
33+
CMD [ "actions-oidc-trigger" ]

docker/add-docker-to-apt.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
# from https://docs.docker.com/engine/install/debian/
3+
4+
set -e
5+
6+
# Add Docker's official GPG key:
7+
apt update
8+
apt install -y ca-certificates curl
9+
install -m 0755 -d /etc/apt/keyrings
10+
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
11+
chmod a+r /etc/apt/keyrings/docker.asc
12+
13+
# Add the repository to Apt sources:
14+
tee /etc/apt/sources.list.d/docker.sources <<EOF
15+
Types: deb
16+
URIs: https://download.docker.com/linux/debian
17+
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
18+
Components: stable
19+
Signed-By: /etc/apt/keyrings/docker.asc
20+
EOF
21+
22+
apt update

0 commit comments

Comments
 (0)