Skip to content

Commit

Permalink
Merge pull request #428 from lhoupert/fix-docker-image-build
Browse files Browse the repository at this point in the history
Fix docker image build
  • Loading branch information
boyter committed Feb 1, 2024
2 parents 43dee65 + 1ef98f1 commit c59b878
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ name: Docker
# documentation.

on:
schedule:
- cron: '36 1 * * *'
#schedule:
# - cron: '36 1 * * *'
push:
branches: [ "master" ]
# Publish semver tags as releases.
Expand Down Expand Up @@ -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
Expand All @@ -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}
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c59b878

Please sign in to comment.