Skip to content

Commit

Permalink
Lang base image
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu committed Feb 20, 2024
1 parent f2c2d23 commit ee8fb6f
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 1 deletion.
39 changes: 38 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:
REGISTRY: ghcr.io

jobs:
deploy:
base-image:
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down Expand Up @@ -56,3 +56,40 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

lang-image:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/appthreat/base-lang
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
context: .
file: al9/Dockerfile.lang
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
42 changes: 42 additions & 0 deletions al9/Dockerfile.lang
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
ARG SYSBASE=almalinux:9
FROM ${SYSBASE} as system-build

RUN mkdir -p /mnt/sys-root; \
dnf install --installroot /mnt/sys-root glibc-minimal-langpack microdnf java-21-openjdk-headless findutils which tar gzip zip unzip sudo \
python3.11 python3.11-devel python3.11-pip \
--releasever 9 --setopt install_weak_deps=false --nodocs -y; \
dnf --installroot /mnt/sys-root clean all;
RUN rm -rf /mnt/sys-root/var/cache/dnf /mnt/sys-root/var/log/dnf* /mnt/sys-root/var/lib/dnf /mnt/sys-root/var/log/yum.*; \
/bin/date +%Y%m%d_%H%M > /mnt/sys-root/etc/BUILDTIME ; \
echo '%_install_langs C.utf8' > /mnt/sys-root/etc/rpm/macros.image-language-conf; \
echo 'LANG="C.utf8"' > /mnt/sys-root/etc/locale.conf; \
echo 'container' > /mnt/sys-root/etc/dnf/vars/infra; \
rm -f /mnt/sys-root/etc/machine-id; \
touch /mnt/sys-root/etc/machine-id; \
touch /mnt/sys-root/etc/resolv.conf; \
touch /mnt/sys-root/etc/hostname; \
touch /mnt/sys-root/etc/.pwd.lock; \
chmod 600 /mnt/sys-root/etc/.pwd.lock; \
rm -rf /mnt/sys-root/usr/share/locale/en* /mnt/sys-root/boot /mnt/sys-root/dev/null /mnt/sys-root/var/log/hawkey.log ; \
echo '0.0 0 0.0' > /mnt/sys-root/etc/adjtime; \
echo '0' >> /mnt/sys-root/etc/adjtime; \
echo 'UTC' >> /mnt/sys-root/etc/adjtime; \
mkdir -p /mnt/sys-root/run/lock; \
cd /mnt/sys-root/etc ; \
ln -s ../usr/share/zoneinfo/UTC localtime

FROM scratch

LABEL maintainer="AppThreat" \
org.opencontainers.image.authors="Team AppThreat <[email protected]>" \
org.opencontainers.image.source="https://github.com/AppThreat/base-images" \
org.opencontainers.image.url="https://github.com/AppThreat/base-images" \
org.opencontainers.image.version="al9" \
org.opencontainers.image.vendor="appthreat" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.title="Base image" \
org.opencontainers.image.description="Base image based on almalinux:9-minimal"

COPY --link --from=system-build /mnt/sys-root/ /

CMD /bin/bash

0 comments on commit ee8fb6f

Please sign in to comment.