-
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.
Split into slim and distroless variants
- Loading branch information
Showing
4 changed files
with
81 additions
and
0 deletions.
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,47 @@ | ||
--- | ||
name: Container image | ||
"on": | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- 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: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=raw,distroless | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
file: Dockerfile.distroless | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
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
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,29 @@ | ||
FROM docker.io/library/debian:12.4-slim as builder | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
build-essential=12.9 \ | ||
ca-certificates=20230311 \ | ||
git=1:2.39.2-1.1 \ | ||
sudo=1.9.13p3-1+deb12u1 | ||
# Not removing cache here because the deps.sh script can use it. | ||
# The cache will not be in the final stage of the image anyway. | ||
|
||
RUN mkdir /simh \ | ||
&& git clone --depth 1 https://github.com/open-simh/simh.git /simh \ | ||
&& /simh/.travis/deps.sh linux \ | ||
&& /simh/cmake/cmake-builder.sh --novideo --noinstall --parallel --target pdp11 | ||
|
||
FROM docker.io/library/debian:12.4-slim | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
libvdeplug2=4.0.1-4 \ | ||
libedit2=3.1-20221030-2 \ | ||
libbsd0=0.11.7-2 \ | ||
libmd0=1.0.4-2 \ | ||
ncurses-base=6.4-4 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=builder /simh/BIN/pdp11 /bin/pdp11 | ||
CMD ["/bin/pdp11"] |