This repository has been archived by the owner on Apr 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
f-bn
committed
Oct 13, 2023
1 parent
5344ce7
commit 0821ebf
Showing
3 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] |