From 2a0266d10a7c20af2fc6813fd41d22de5d530921 Mon Sep 17 00:00:00 2001 From: lhoupert <10154151+lhoupert@users.noreply.github.com> Date: Thu, 1 Feb 2024 01:46:55 +0000 Subject: [PATCH 1/3] ci: add arm64 build --- .github/workflows/docker-publish.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 99b353ddc..ff6d96543 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -6,8 +6,8 @@ name: Docker # documentation. on: - schedule: - - cron: '36 1 * * *' + #schedule: + # - cron: '36 1 * * *' push: branches: [ "master" ] # Publish semver tags as releases. @@ -76,11 +76,10 @@ jobs: uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 with: context: . + platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max # Sign the resulting Docker image digest except on PRs. # This will only write to the public Rekor transparency log when the Docker @@ -95,4 +94,4 @@ jobs: DIGEST: ${{ steps.build-and-push.outputs.digest }} # This step uses the identity token to provision an ephemeral certificate # against the sigstore community Fulcio instance. - run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} + run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} \ No newline at end of file From 79a902b9c6800d52c17b0c590ffb57cdc4ac7a2b Mon Sep 17 00:00:00 2001 From: lhoupert <10154151+lhoupert@users.noreply.github.com> Date: Thu, 1 Feb 2024 01:47:51 +0000 Subject: [PATCH 2/3] fix: dockerimage configuration --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 25e9c582a..6735aa9a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,10 +5,10 @@ GOARCH=amd64 \ CGO_ENABLED=0 ARG VERSION=v3.2.0 -RUN git clone --branch $VERSION --depth 1 https://github.com/boyter/scc -WORKDIR /go/scc -RUN go build -ldflags="-s -w" +COPY . /scc +WORKDIR /scc +RUN go build -ldflags="-s -w" -o /bin/scc FROM alpine:3.19 -COPY --from=scc-get /go/scc/scc /bin/ -ENTRYPOINT ["scc"] +COPY --from=scc-get /bin/scc /bin/scc +CMD ["/bin/scc"] \ No newline at end of file From 1ef98f190ac768717dcd1bc332910e098fd8a0a7 Mon Sep 17 00:00:00 2001 From: lhoupert <10154151+lhoupert@users.noreply.github.com> Date: Thu, 1 Feb 2024 01:49:38 +0000 Subject: [PATCH 3/3] chore: update readme on how to run docker --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index d01035438..3b54c1df7 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,16 @@ Or, if you prefer to build from source, you can use the ports tree `$ cd /usr/ports/devel/scc && make install clean` +### Run in Docker + +Go to the directory you want to run scc from. + +Run the command below to run the latest release of scc on your current working directory: + +``` +docker run --rm -it -v "$PWD:/pwd" ghcr.io/lhoupert/scc:master scc /pwd +``` + #### Manual Binaries for Windows, GNU/Linux and macOS for both i386 and x86_64 machines are available from the [releases](https://github.com/boyter/scc/releases) page.