-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Go 1.21, default.pgo, alpine + ubuntu-22.04/20.04 images (#469)
* Bump Go version * Add .dockerignore * Update CI * Update CI * Build images with matrix * Remove Set version step * Refactor Makefile * Remove BuildTime * Separate dev/github Dockerfiles * Build for many targets * Paste default.pgo
- Loading branch information
1 parent
a86de35
commit c5f2968
Showing
12 changed files
with
101 additions
and
62 deletions.
There are no files selected for viewing
This file contains 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,4 @@ | ||
./file.d | ||
.git | ||
.idea | ||
.vscode |
This file contains 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 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 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 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 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 @@ | ||
ARG APP_IMAGE=ubuntu:latest | ||
|
||
# Build | ||
FROM --platform=$BUILDPLATFORM golang:1.21-alpine AS build | ||
|
||
ARG VERSION | ||
ARG BUILD_TIME | ||
|
||
WORKDIR /file.d | ||
|
||
COPY go.mod go.sum ./ | ||
|
||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
ENV CGO_ENABLED 0 | ||
ENV GOOS linux | ||
ENV GOARCH amd64 | ||
|
||
RUN go build -trimpath \ | ||
-pgo default.pgo \ | ||
-ldflags "-X github.com/ozontech/file.d/buildinfo.Version=${VERSION}" \ | ||
-o file.d ./cmd/file.d | ||
|
||
# Deploy | ||
FROM $APP_IMAGE | ||
|
||
WORKDIR /file.d | ||
|
||
COPY --from=build /file.d/file.d /file.d/file.d | ||
|
||
CMD [ "./file.d" ] |
This file contains 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 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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
package buildinfo | ||
|
||
var ( | ||
Version string | ||
BuildTime string | ||
Version string | ||
) |
This file contains 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
Binary file not shown.
This file contains 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.