Skip to content

Commit

Permalink
optimize Dockerfile
Browse files Browse the repository at this point in the history
Signed-off-by: Clavin June <[email protected]>
  • Loading branch information
clavinjune committed Dec 3, 2021
1 parent 35ad418 commit 3cf69aa
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
.golangci.yml
.goreleaser.yml
CNAME
Dockerfile
LICENSE
Makefile
tools.mk
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: 1.17.3
go-version: 1.17.4

- uses: actions/cache@v2
with:
Expand All @@ -54,6 +54,7 @@ jobs:

- if: startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push'
run: |
mkdir -p src/
brew install upx
make ci/release
Expand Down
2 changes: 2 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ dockers:
- "ghcr.io/clavinjune/serve:{{ .ShortCommit }}"
- "ghcr.io/clavinjune/serve:latest"
skip_push: auto
extra_files:
- src/
changelog:
sort: asc
filters:
Expand Down
9 changes: 2 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.17.3-alpine3.14 as builder
LABEL builder="true"
RUN mkdir -p /build/src

FROM gcr.io/distroless/static
FROM gcr.io/distroless/static:latest
WORKDIR /app
COPY --from=builder /build/src src
COPY serve .
COPY . .
ENTRYPOINT [ "/app/serve", "-r", "/app/src" ]
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,7 @@ fmt:
@go run $(licenser) apply -r "ClavinJune/serve" 2> /dev/null

release:
@GITHUB_TOKEN="${GITHUB_PAT}" go run $(releaser) release --rm-dist
@GITHUB_TOKEN="${GITHUB_PAT}" go run $(releaser) release --rm-dist

snapshot:
@GITHUB_TOKEN="${GITHUB_PAT}" go run $(releaser) release --rm-dist --snapshot
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
)

const (
version string = "v0.3.6"
version string = "v0.3.7"
)

var (
Expand Down

0 comments on commit 3cf69aa

Please sign in to comment.