Skip to content

Commit

Permalink
fix: bug for docker dns problem
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotxx committed Nov 3, 2020
1 parent cbf0442 commit 4f97389
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ ENV GO111MODULE=on
ENV GOPROXY=https://mirrors.aliyun.com/goproxy/
RUN go mod tidy
# 编译,生成二进制文件
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags "-extldflags -static" -o cmd/watchman cmd/main.go


RUN CGO_ENABLED=1 GOOS=linux go build --ldflags '-linkmode external -extldflags "-static -s -w"' -o cmd/watchman cmd/main.go

# 运行层
FROM alpine:3.7 AS production
Expand All @@ -44,6 +42,8 @@ ENV GIN_PORT=8080
ENV TMPDIR="/data"
# 容器中支持中文
ENV LANG=C.UTF-8
# 设置go语言的默认DNS解析方式 纯go
ENV GODEBUG=netdns=go

# 安装必要工具,设置 alpine 的镜像地址为阿里云的地址
RUN echo "https://mirrors.aliyun.com/alpine/v3.6/main/" > /etc/apk/repositories \
Expand Down
2 changes: 1 addition & 1 deletion default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ server {
#charset koi8-r;

# 设置日志输出
access_log /data/nginx.access.log main;
access_log /data/nginx.access.log;
error_log /data/nginx.error.log error;

location / {
Expand Down

0 comments on commit 4f97389

Please sign in to comment.