mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-24 13:56:57 +00:00
fix
This commit is contained in:
parent
bf39323b71
commit
caabfd32f2
1 changed files with 5 additions and 5 deletions
10
Dockerfile
10
Dockerfile
|
@ -1,12 +1,12 @@
|
|||
# Set the default Go version as a build argument
|
||||
ARG XGO="go-1.20.x"
|
||||
|
||||
# Use xgo (a Go cross-compiler tool) as the base image
|
||||
# Use xgo (a Go cross-compiler tool) as build image
|
||||
FROM --platform=$BUILDPLATFORM techknowlogick/xgo:${XGO} as build
|
||||
|
||||
# Set the working directory to /workspace and copy the source code
|
||||
WORKDIR /workspace
|
||||
COPY . .
|
||||
# Set the working directory and copy the source code
|
||||
WORKDIR /go/src/codeberg.org/codeberg/pages
|
||||
COPY . /go/src/codeberg.org/codeberg/pages
|
||||
|
||||
# Set the target architecture (can be set using --build-arg), buildx set it automatically
|
||||
ARG TARGETOS TARGETARCH
|
||||
|
@ -15,7 +15,7 @@ ARG TARGETOS TARGETARCH
|
|||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||
--mount=type=cache,target=/go/pkg \
|
||||
GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=1 \
|
||||
go build -tags 'sqlite sqlite_unlock_notify netgo' -ldflags '-s -w -extldflags "-static" -linkmode external' .
|
||||
/build.sh -race -tags='sqlite sqlite_unlock_notify netgo' -ldflags='-s -w -extldflags "-static" -linkmode external' .
|
||||
|
||||
# Use a scratch image as the base image for the final container,
|
||||
# which will contain only the built binary and the CA certificates
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue