Skip to content

Commit 2d8633a

Browse files
committed
Create a base image
1 parent b0fa4d5 commit 2d8633a

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

.github/workflows/docker.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,39 @@ jobs:
3030
username: ${{ github.actor }}
3131
password: ${{ secrets.GITHUB_TOKEN }}
3232

33+
- name: Build and push the base image
34+
uses: docker/build-push-action@v5
35+
if: success() && github.event_name != 'pull_request'
36+
with:
37+
context: .
38+
file: Dockerfile.base
39+
platforms: linux/${{ matrix.platform }}
40+
push: ${{ github.event_name != 'pull_request' }}
41+
provenance: false
42+
tags: |
43+
ghcr.io/${{ github.repository }}-base:${{ github.sha }}-${{ matrix.platform }}
44+
ghcr.io/${{ github.repository }}-base:latest-${{ matrix.platform }}
45+
labels: |
46+
org.opencontainers.image.revision=${{ github.sha }}
47+
org.opencontainers.image.source=ssh://[email protected]:${{ github.repository }}.git
48+
org.opencontainers.image.url=https://github.com/${{ github.repository }}
49+
cache-from: type=gha
50+
cache-to: type=gha,mode=max
51+
52+
- name: Create and push the base manifest
53+
run: |
54+
docker manifest create \
55+
ghcr.io/${{ github.repository }}-base:${{ github.sha }} \
56+
--amend ghcr.io/${{ github.repository }}-base:${{ github.sha }}-amd64
57+
58+
docker manifest push ghcr.io/${{ github.repository }}-base:${{ github.sha }}
59+
60+
docker manifest create \
61+
ghcr.io/${{ github.repository }}-base:latest \
62+
--amend ghcr.io/${{ github.repository }}-base:${{ github.sha }}-amd64
63+
64+
docker manifest push ghcr.io/${{ github.repository }}-base:latest
65+
3366
- name: Build and push the image
3467
uses: docker/build-push-action@v5
3568
if: success() && github.event_name != 'pull_request'

Dockerfile.base

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# The Unlicense
2+
#
3+
# This is free and unencumbered software released into the public domain.
4+
# Anyone is free to copy, modify, distribute, and perform the software, as well as
5+
# to sublicense it, all without any conditions whatsoever.
6+
#
7+
# See the full text of the Unlicense at: https://unlicense.org/
8+
9+
FROM archlinux:latest@sha256:901cf83a14f09d9ba70b219e22f67abd4d6346cb6d3f0c048cd08f22fb9a7425
10+
11+
LABEL org.opencontainers.image.authors="bbhtt <[email protected]>"
12+
13+
RUN echo -e "keyserver-options auto-key-retrieve" >> /etc/pacman.d/gnupg/gpg.conf && \
14+
sed -i '/CheckSpace/s/^/#/g' /etc/pacman.conf && \
15+
sed -i '/OPTIONS/s/debug/!debug/g' /etc/makepkg.conf && \
16+
pacman-key --init && pacman --noconfirm -Syyuu
17+
18+
RUN pacman --noconfirm --needed -S base base-devel bat desktop-file-utils \
19+
diffoscope diffutils wl-clipboard eza flatpak-builder git-delta \
20+
micro qemu-base starship swtpm time traceroute trash-cli tree wget \
21+
zsh inetutils fzf python-pip python-virtualenv python-gitlab ruff \
22+
python-pylint python-ruamel-yaml libabigail openssh gnupg less \
23+
python-gitlab python-ruamel-yaml python-packaging python-pyelftools \
24+
python-urllib3 python-pyaml lzip python-gitpython python-tabulate \
25+
man-db

0 commit comments

Comments
 (0)