Skip to content

Commit 3de4cf6

Browse files
committed
Add test containers
0 parents  commit 3de4cf6

File tree

4 files changed

+103
-0
lines changed

4 files changed

+103
-0
lines changed

.github/workflows/container.yaml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Create and publish a Docker image
2+
on:
3+
push:
4+
pull_request:
5+
schedule:
6+
# New image every monday morning
7+
- cron: '42 0 * * 1'
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
IMAGE_NAME: ${{ github.repository }}
12+
13+
jobs:
14+
build-and-push-image:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
packages: write
19+
strategy:
20+
matrix:
21+
variant:
22+
- fakemachine-bullseye
23+
- fakemachine-bookworm
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v2
27+
28+
- name: Log in to the Container registry
29+
uses: docker/login-action@v1
30+
with:
31+
registry: ${{ env.REGISTRY }}
32+
username: ${{ github.actor }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Extract metadata (tags, labels) for Docker
36+
id: meta
37+
uses: docker/metadata-action@v3
38+
with:
39+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ matrix.variant }}
40+
tags: |
41+
"type=ref,event=branch"
42+
"type=ref,suffix=-{{sha}},event=branch"
43+
"type=ref,suffix=-{{date 'YYYYMMDD'}},event=branch"
44+
"type=ref,event=tag"
45+
"type=ref,event=pr"
46+
47+
- name: Build and push Docker image
48+
uses: docker/build-push-action@v2
49+
with:
50+
context: .
51+
file: Dockerfile.${{ matrix.variant }}
52+
push: ${{ github.event_name != 'pull_request' }}
53+
tags: ${{ steps.meta.outputs.tags }}
54+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile.fakemachine-bookworm

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM debian:bookworm-slim
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
5+
# Always install procps in case the docker file gets used in jenkins
6+
RUN apt update && apt-get install --no-install-recommends -y procps
7+
8+
# Bits needed to run fakemachine
9+
RUN apt-get update && \
10+
apt-get install --no-install-recommends -y qemu-system-x86 \
11+
qemu-user-static \
12+
busybox \
13+
linux-image-amd64 \
14+
systemd \
15+
dbus
16+
17+
# Bits needed to build fakemachine
18+
RUN apt-get update && \
19+
apt-get install --no-install-recommends -y \
20+
golang-go \
21+
git \
22+
ca-certificates \
23+
gcc \
24+
libc6-dev

Dockerfile.fakemachine-bullseye

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM debian:bullseye-slim
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
5+
# Always install procps in case the docker file gets used in jenkins
6+
RUN apt update && apt-get install --no-install-recommends -y procps
7+
8+
# Bits needed to run fakemachine
9+
RUN apt-get update && \
10+
apt-get install --no-install-recommends -y qemu-system-x86 \
11+
qemu-user-static \
12+
busybox \
13+
linux-image-amd64 \
14+
systemd \
15+
dbus
16+
17+
# Bits needed to build fakemachine
18+
RUN apt-get update && \
19+
apt-get install --no-install-recommends -y \
20+
golang-go \
21+
git \
22+
ca-certificates \
23+
gcc \
24+
libc6-dev

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Test containers for debos and fakemachine

0 commit comments

Comments
 (0)