Skip to content
This repository has been archived by the owner on Apr 7, 2024. It is now read-only.

Commit

Permalink
feat: add initial ubuntu image
Browse files Browse the repository at this point in the history
  • Loading branch information
f-bn committed Oct 13, 2023
1 parent 5344ce7 commit 0821ebf
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: Build Ubuntu Molecule image
on:
push:
branches:
- main
paths:
- ubuntu/**
- .github/workflows/ubuntu.yml
# schedule:
# - cron: ''
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
release: ['jammy']
steps:
- name: Generate build id (based on timestamp)
run: |
echo BUILD_ID=$(date +'%Y%m%d%H%M') >> $GITHUB_ENV
- name: Check-out repository
uses: actions/checkout@v4

- name: Set up QEMU (for multi-arch build)
uses: docker/setup-qemu-action@v3

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

- name: Login to Docker Hub registry
uses: docker/login-action@v3
with:
username: ${{ secrets.REGISTRY_HUB_USERNAME }}
password: ${{ secrets.REGISTRY_HUB_PASSWORD }}

- name: Build and push image to Docker Hub registry
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: ./ubuntu
file: ./ubuntu/Dockerfile.${{ matrix.release }}
push: true
build-args: |
RELEASE=${{ matrix.release }}
tags: |
${{ secrets.REGISTRY_HUB_USERNAME }}/molecule-ubuntu:${{ matrix.release }}
${{ secrets.REGISTRY_HUB_USERNAME }}/molecule-ubuntu:${{ matrix.release }}-${{ env.BUILD_ID }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Custom images for Ansible Molecule testing in GitHub Actions.

| Name | Tags | Architectures |
| :-------------------------| :------------------| :------------------|
| [molecule-ubuntu](ubuntu/)| `22.04` | `x86_64`,`aarch64` |
| [molecule-ubuntu](ubuntu/)| `jammy` | `x86_64`,`aarch64` |
16 changes: 16 additions & 0 deletions ubuntu/Dockerfile.jammy
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ARG RELEASE="jammy"

FROM public.ecr.aws/ubuntu/ubuntu:${RELEASE}_stable

RUN set -ex ; \
export DEBIAN_FRONTEND=noninteractive; \
apt update ; \
apt install -y systemd systemd-sysv iproute2 python3 sudo hostname procps ca-certificates gnupg ; \
apt clean all ; \
rm -rf /var/lib/apt/lists/* ;

RUN truncate -s0 /etc/machine-id

STOPSIGNAL SIGRTMIN+3

CMD [ "/sbin/init" ]

0 comments on commit 0821ebf

Please sign in to comment.