-
-
Notifications
You must be signed in to change notification settings - Fork 436
chore: set up docker buildx bake #862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Xe
wants to merge
6
commits into
main
Choose a base branch
from
Xe/docker-buildx-bake2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b2b7183
chore: set up docker buildx bake
Xe ca36cb0
docs(CHANGELOG): update for buildx bake
Xe b0757a8
Update metadata
Xe c81c214
test: use docker buildx bake
Xe 492d9b3
ci(docker): set version based on git metadata
Xe 9499903
Merge branch 'main' into Xe/docker-buildx-bake2
Xe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| .env | ||
| *.deb | ||
| *.rpm | ||
|
|
||
| # Additional package locks | ||
| pnpm-lock.yaml | ||
| yarn.lock | ||
|
|
||
| # Go binaries and test artifacts | ||
| main | ||
| *.test | ||
|
|
||
| node_modules | ||
|
|
||
| # MacOS | ||
| .DS_store | ||
|
|
||
| # Intellij | ||
| .idea | ||
|
|
||
| # how does this get here | ||
| doc/VERSION | ||
|
|
||
| web/static/js/* | ||
| !web/static/js/.gitignore | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| variable "ALPINE_VERSION" { default = "3.22" } | ||
| variable "GITHUB_SHA" { default = "devel" } | ||
| variable "VERSION" { default = "devel-docker" } | ||
|
|
||
| group "default" { | ||
| targets = [ | ||
| "anubis", | ||
| ] | ||
| } | ||
|
|
||
| target "anubis" { | ||
| args = { | ||
| ALPINE_VERSION = "3.22" | ||
| VERSION = "${VERSION}" | ||
| } | ||
| context = "." | ||
| dockerfile = "./docker/anubis.Dockerfile" | ||
| platforms = [ | ||
| "linux/386", | ||
| "linux/amd64", | ||
| "linux/arm64", | ||
| "linux/arm/v7", | ||
| "linux/ppc64le", | ||
| "linux/riscv64", | ||
| ] | ||
| pull = true | ||
| sbom = true | ||
|
||
| provenance = true | ||
| tags = [ | ||
| "ghcr.io/techarohq/anubis:${VERSION}", | ||
| "ghcr.io/techarohq/anubis:main" | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| ARG ALPINE_VERSION=edge | ||
| FROM --platform=${BUILDPLATFORM} alpine:${ALPINE_VERSION} AS build | ||
|
|
||
| RUN apk -U add go nodejs git build-base git npm bash zstd brotli gzip | ||
|
||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY go.mod go.sum ./ | ||
| RUN \ | ||
| --mount=type=cache,target=/root/.cache \ | ||
| --mount=type=cache,target=/root/go \ | ||
| go mod download | ||
|
|
||
| COPY package.json package-lock.json ./ | ||
| RUN \ | ||
| --mount=type=cache,target=/app/node_modules \ | ||
| npm ci | ||
|
|
||
| COPY . . | ||
| RUN \ | ||
| --mount=type=cache,target=/root/.cache \ | ||
| --mount=type=cache,target=/root/go \ | ||
| --mount=type=cache,target=/app/node_modules \ | ||
| npm run assets | ||
|
|
||
| ARG TARGETOS | ||
| ARG TARGETARCH | ||
| ARG VERSION=devel-docker | ||
|
|
||
| RUN \ | ||
| --mount=type=cache,target=/root/.cache \ | ||
| --mount=type=cache,target=/root/go \ | ||
| --mount=type=cache,target=/app/node_modules \ | ||
| GOOS=${TARGETOS} \ | ||
| GOARCH=${TARGETARCH} \ | ||
| CGO_ENABLED=0 \ | ||
| GOARM=7 \ | ||
| go build \ | ||
| -gcflags "all=-N -l" \ | ||
|
||
| -o /app/bin/anubis \ | ||
| -ldflags "-s -w -extldflags -static -X github.com/TecharoHQ/anubis.Version=${VERSION}" \ | ||
| ./cmd/anubis | ||
|
|
||
| FROM alpine:${ALPINE_VERSION} AS run | ||
| WORKDIR /app | ||
|
|
||
| RUN apk -U add ca-certificates mailcap | ||
|
||
|
|
||
| COPY --from=build /app/bin/anubis /app/bin/anubis | ||
|
|
||
| CMD ["/app/bin/anubis"] | ||
| HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD [ "/app/bin/anubis", "--healthcheck" ] | ||
|
|
||
| LABEL org.opencontainers.image.source="https://github.com/TecharoHQ/anubis" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var too? I feel like there is 100% more we can add to this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var has a separate gitignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure but gitignore != dockerignore