Skip to content

Commit

Permalink
dockerfile without proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
ttktatakai committed Jun 28, 2024
1 parent bb0afe3 commit e0ee9d0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
FROM golang:alpine
RUN set -eux && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
# RUN set -eux && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk add tzdata
RUN apk add build-base
ENV TZ=Asia/Shanghai
WORKDIR /messenger
COPY . .
RUN go env -w GOPROXY=https://goproxy.cn,direct \
&& CGO_ENABLED=1 go build -o ./messenger ./main.go
# RUN go env -w GOPROXY=https://goproxy.cn,direct \
# && CGO_ENABLED=1 go build -o ./messenger ./main.go
RUN CGO_ENABLED=1 go build -o ./messenger ./main.go

FROM alpine:latest
RUN set -eux && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
# RUN set -eux && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk add tzdata
ENV TZ=Asia/Shanghai
WORKDIR /messenger
Expand Down

0 comments on commit e0ee9d0

Please sign in to comment.