-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* chore: fix badge of docker build gh action * fix: Dockerfile for multiarch * fix: #298 Docker build failure * chore: add usage of Docker and notes for dictionary
- Loading branch information
Showing
6 changed files
with
168 additions
and
221 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 @@ | ||
dist |
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,39 +1,3 @@ | ||
# This is a Docker image of Kagome on Alpine Linux. | ||
# ================================================= | ||
|
||
# 1st stage: Build binary. | ||
# ------------------------ | ||
FROM --platform=$BUILDPLATFORM golang:alpine AS build-app | ||
|
||
ARG BUILDPLATFORM | ||
ARG TARGETPLATFORM | ||
ARG GOOS=linux | ||
ARG GOARCH=amd64 | ||
ARG GOARM= | ||
|
||
# Copy the current dir including .git dir for versioning. | ||
COPY . /go/src/github.com/ikawaha/kagome | ||
WORKDIR /go/src/github.com/ikawaha/kagome | ||
|
||
# Shell script to build the image (with the tag as version). | ||
RUN \ | ||
apk --no-cache add git && \ | ||
version_app=$(git describe --tag) && \ | ||
echo "- Running on ${BUILDPLATFORM}, building for ${TARGETPLATFORM}" && \ | ||
echo "- Current platform: $(uname -a)" && \ | ||
echo "- Current git tag: ${version_app}" && \ | ||
echo "- Current Go version: $(go version)" && \ | ||
echo "- Kagome version to be build:${version_app}" && \ | ||
CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} GOARM=${GOARM} go build \ | ||
--ldflags "-w -s -extldflags \"-static\" -X 'main.version=${version_app}'" \ | ||
-o /go/bin/kagome \ | ||
/go/src/github.com/ikawaha/kagome && \ | ||
echo "- Smoke test (run kagome version command) ... $(/go/bin/kagome version)" | ||
|
||
# 2nd stage: Copy only the built binary to shrink the image size. | ||
# --------------------------------------------------------------- | ||
FROM --platform=$BUILDPLATFORM alpine:latest | ||
|
||
COPY --from=build-app /go/bin/kagome /usr/local/bin/kagome | ||
|
||
ENTRYPOINT [ "kagome" ] | ||
FROM scratch | ||
COPY kagome / | ||
ENTRYPOINT ["/kagome"] |
Oops, something went wrong.