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 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 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.