From 89f6f75735bca156d18568ea815d4031441b2fbd Mon Sep 17 00:00:00 2001 From: Lee Katz Date: Thu, 2 Nov 2023 12:37:09 -0400 Subject: [PATCH] Docker fixes (#19) * Dockerfile: change to debian commands * docker.yml: run on docker branch too * Dockerfile: update apt-get packages for debian * Dockerfile: linux-headers-amd64 * Dockefile: apt-get install -y * Dockerfile: Fix order * Dockerfile: Fix whitespace issue * Dockerfile: add tag label * Docker.yml: update metadata-action * Dockerfile: add unit tests * Dockerfile: cargo build debug target * Dockerfile: install bc --- .github/workflows/docker.yml | 4 ++-- Dockerfile | 16 ++++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 11554149..1e8f2a92 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 @@ -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 }} diff --git a/Dockerfile b/Dockerfile index 6c86bfbe..124341eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,23 +12,27 @@ 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 apk update -RUN apk add --no-cache \ +RUN apt-get update +RUN apt-get install -y \ ca-certificates \ - build-base \ - linux-headers \ + linux-headers-amd64 \ git \ - openssl-dev \ - util-linux-dev \ + bc \ + libcurl4-openssl-dev \ libseccomp-dev 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} RUN cd /usr/src/app/fasten && cargo build --release +RUN cd /usr/src/app/fasten \ + && cargo build \ + && (set -ex; for i in tests/fasten*.sh; do bash $i; done;) # build final container