Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Update base image
Browse files Browse the repository at this point in the history
  • Loading branch information
maolonglong committed Mar 29, 2022
1 parent 5721c52 commit 83505b1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ builds:
- darwin
goarch:
- amd64
flags:
- -v
- -trimpath
ldflags:
- -s -w
- -X main.commit={{.ShortCommit}}
Expand Down
20 changes: 7 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
FROM golang:1.18-alpine AS builder
FROM golang:1.18 AS build-env

ARG COMMIT=""

ENV GO111MODULE=on \
CGO_ENABLED=0 \
GOPROXY=https://proxy.golang.org

WORKDIR /code
WORKDIR /go/src/go.chensl.me/redix
COPY . .

RUN go build -o /usr/bin/redix-server \
RUN go build -v -o /go/bin/redix-server \
-trimpath -buildvcs=false \
-ldflags "-w -s -X main.commit=${COMMIT}" \
-ldflags "-s -w -X main.commit=${COMMIT}" \
./server/cmd/redix-server

RUN apk add --no-cache upx && upx -9 /usr/bin/redix-server

FROM scratch

COPY --from=builder /usr/bin/redix-server /usr/bin/redix-server

EXPOSE 6380

ENTRYPOINT [ "redix-server" ]
FROM gcr.io/distroless/static
COPY --from=build-env /go/bin/redix-server /
ENTRYPOINT [ "/redix-server" ]
4 changes: 0 additions & 4 deletions server/pkg/bytesconv/bytesconv.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// Copyright 2021 MaoLongLong. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

// copied from https://github.com/gin-gonic/gin/blob/master/internal/bytesconv/bytesconv.go

package bytesconv
Expand Down

0 comments on commit 83505b1

Please sign in to comment.