From dd76dfab51b12c824f5c2895fc08b19a60869eb8 Mon Sep 17 00:00:00 2001 From: Lee Katz - Aspen Date: Thu, 2 Nov 2023 10:57:30 -0400 Subject: [PATCH 01/12] Dockerfile: change to debian commands --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6c86bfbe..cb806214 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,8 +13,8 @@ LABEL maintainer="Lee Katz" LABEL maintainer.email="gzu2@cdc.gov" LABEL maintainer2="John Phan" -RUN apk update -RUN apk add --no-cache \ +RUN apt-get update +RUN apt-get install \ ca-certificates \ build-base \ linux-headers \ @@ -26,6 +26,7 @@ RUN apk add --no-cache \ RUN mkdir -p /usr/src/app \ && cd /usr/src/app \ && git clone https://github.com/lskatz/fasten \ + && git checkout v${SOFTWARE_VER} \ && cd /usr/src/app/fasten \ RUN cd /usr/src/app/fasten && cargo build --release From d9406e2c8e628954674c6c951502af7171fa95b4 Mon Sep 17 00:00:00 2001 From: Lee Katz - Aspen Date: Thu, 2 Nov 2023 10:58:33 -0400 Subject: [PATCH 02/12] docker.yml: run on docker branch too --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 11554149..4acc4648 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -7,7 +7,7 @@ name: Create and publish a Docker image on: push: - branches: [master, main] + branches: [master, main, docker] env: REGISTRY: ghcr.io From 441e5ce3a315387f7532bdda9e2932f7e37a44f4 Mon Sep 17 00:00:00 2001 From: Lee Katz - Aspen Date: Thu, 2 Nov 2023 11:05:46 -0400 Subject: [PATCH 03/12] Dockerfile: update apt-get packages for debian --- Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index cb806214..792081a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,11 +16,9 @@ LABEL maintainer2="John Phan" RUN apt-get update RUN apt-get install \ ca-certificates \ - build-base \ linux-headers \ git \ - openssl-dev \ - util-linux-dev \ + libcurl4-openssl-dev \ libseccomp-dev RUN mkdir -p /usr/src/app \ From e18a3a6a17ced06d9641dd3112bd6de895925786 Mon Sep 17 00:00:00 2001 From: Lee Katz - Aspen Date: Thu, 2 Nov 2023 11:08:01 -0400 Subject: [PATCH 04/12] Dockerfile: linux-headers-amd64 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 792081a8..85050af0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ LABEL maintainer2="John Phan" RUN apt-get update RUN apt-get install \ ca-certificates \ - linux-headers \ + linux-headers-amd64 \ git \ libcurl4-openssl-dev \ libseccomp-dev From f81edbebceadd534f2a282bcc000ecdc92d8b054 Mon Sep 17 00:00:00 2001 From: Lee Katz - Aspen Date: Thu, 2 Nov 2023 11:09:49 -0400 Subject: [PATCH 05/12] Dockefile: apt-get install -y --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 85050af0..1625e4a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ LABEL maintainer.email="gzu2@cdc.gov" LABEL maintainer2="John Phan" RUN apt-get update -RUN apt-get install \ +RUN apt-get install -y \ ca-certificates \ linux-headers-amd64 \ git \ From 3a5fd09d8bf44fd387622271e9b0839d34e2957e Mon Sep 17 00:00:00 2001 From: Lee Katz - Aspen Date: Thu, 2 Nov 2023 11:12:41 -0400 Subject: [PATCH 06/12] Dockerfile: Fix order --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1625e4a5..eccc21d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,8 +24,8 @@ RUN apt-get install -y \ RUN mkdir -p /usr/src/app \ && cd /usr/src/app \ && git clone https://github.com/lskatz/fasten \ - && git checkout v${SOFTWARE_VER} \ && cd /usr/src/app/fasten \ + && git checkout v${SOFTWARE_VER} \ RUN cd /usr/src/app/fasten && cargo build --release From c27891cdaad46214f7f7311cec98b7b044664e0b Mon Sep 17 00:00:00 2001 From: Lee Katz - Aspen Date: Thu, 2 Nov 2023 11:18:13 -0400 Subject: [PATCH 07/12] Dockerfile: Fix whitespace issue --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index eccc21d9..0ed00026 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ RUN mkdir -p /usr/src/app \ && cd /usr/src/app \ && git clone https://github.com/lskatz/fasten \ && cd /usr/src/app/fasten \ - && git checkout v${SOFTWARE_VER} \ + && git checkout v${SOFTWARE_VER} RUN cd /usr/src/app/fasten && cargo build --release From e35e65d18dfca3604047f642abdfe5c8ad3a07af Mon Sep 17 00:00:00 2001 From: Lee Katz - Aspen Date: Thu, 2 Nov 2023 11:28:06 -0400 Subject: [PATCH 08/12] Dockerfile: add tag label --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 0ed00026..347ffc56 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,7 @@ LABEL license="https://github.com/lskatz/fasten/LICENSE" LABEL maintainer="Lee Katz" LABEL maintainer.email="gzu2@cdc.gov" LABEL maintainer2="John Phan" +LABEL tag="${SOFTWARE_VER}" RUN apt-get update RUN apt-get install -y \ From abb8e00b518ab7137c898e2d26f3aaa7e90de8e0 Mon Sep 17 00:00:00 2001 From: Lee Katz - Aspen Date: Thu, 2 Nov 2023 11:34:03 -0400 Subject: [PATCH 09/12] Docker.yml: update metadata-action --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4acc4648..1e8f2a92 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -33,7 +33,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} From af021edac451b9adecb172a1fa09c2ed9e034ecb Mon Sep 17 00:00:00 2001 From: Lee Katz - Aspen Date: Thu, 2 Nov 2023 11:40:22 -0400 Subject: [PATCH 10/12] Dockerfile: add unit tests --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 347ffc56..a0c38898 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,6 +29,8 @@ RUN mkdir -p /usr/src/app \ && git checkout v${SOFTWARE_VER} RUN cd /usr/src/app/fasten && cargo build --release +RUN cd /usr/src/app/fasten \ + && (set -e; for i in tests/fasten*.sh; do bash $i; done;) # build final container From 7a3b99f62bdda146e6c491d4c28f7677b6130f87 Mon Sep 17 00:00:00 2001 From: Lee Katz - Aspen Date: Thu, 2 Nov 2023 11:43:32 -0400 Subject: [PATCH 11/12] Dockerfile: cargo build debug target --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index a0c38898..f4c5aa2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,6 +30,7 @@ RUN mkdir -p /usr/src/app \ RUN cd /usr/src/app/fasten && cargo build --release RUN cd /usr/src/app/fasten \ + && cargo build \ && (set -e; for i in tests/fasten*.sh; do bash $i; done;) # build final container From 229e0b32d4dc011f224cb787bcef71d69e70c262 Mon Sep 17 00:00:00 2001 From: Lee Katz - Aspen Date: Thu, 2 Nov 2023 12:33:32 -0400 Subject: [PATCH 12/12] Dockerfile: install bc --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f4c5aa2e..124341eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,7 @@ RUN apt-get install -y \ ca-certificates \ linux-headers-amd64 \ git \ + bc \ libcurl4-openssl-dev \ libseccomp-dev @@ -31,7 +32,7 @@ RUN cd /usr/src/app/fasten && cargo build --release RUN cd /usr/src/app/fasten \ && cargo build \ - && (set -e; for i in tests/fasten*.sh; do bash $i; done;) + && (set -ex; for i in tests/fasten*.sh; do bash $i; done;) # build final container