Skip to content

Commit

Permalink
支持docker
Browse files Browse the repository at this point in the history
  • Loading branch information
zc2638 committed Sep 15, 2022
1 parent 7db080d commit 910de90
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
ylgy --token <your-custom-token>
```

### Docker
执行以下命令前,将 `<your-custom-token>` 替换为实际内容
```shell
docker run --rm -it zc2638/ylgy sh -c 'ylgy --token <your-custom-token>'
```

## 抓包

[Charles抓包教程](https://www.jianshu.com/p/ff85b3dac157)
Expand Down
30 changes: 30 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM golang:1.19 as builder
ENV GOPROXY=https://goproxy.cn,https://goproxy.io,direct
ENV GO111MODULE=on
ENV GOCACHE=/go/pkg/.cache/go-build

WORKDIR /work
ADD . .
RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o /usr/local/bin/ylgy github.com/zc2638/ylgy/cmd/ylgy

FROM alpine:3.6 as alpine
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
apk update && \
apk add -U --no-cache ca-certificates tzdata

FROM alpine:3.6
MAINTAINER zc
LABEL maintainer="zc" \
email="[email protected]"

ENV TZ="Asia/Shanghai"

COPY --from=alpine /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /usr/local/bin/ylgy /usr/local/bin/ylgy

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo $TZ > /etc/timezone

WORKDIR /work
CMD ["ylgy"]

0 comments on commit 910de90

Please sign in to comment.