a
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
FROM golang:1.10.3-alpine as builder
|
||||
FROM golang:1.10.3-alpine
|
||||
ARG GOPROXY_VERSION=master
|
||||
RUN apk update && apk upgrade && \
|
||||
apk add --no-cache git && \
|
||||
|
||||
10
README.md
10
README.md
@ -173,12 +173,12 @@ chmod +x install.sh
|
||||
|
||||
#### Docker installation
|
||||
|
||||
Dockerfile root of project uses multistage build and alpine project to comply with best practices. Uses golang 1.10.3 for building as noted in the project README.md and will be pretty small image. total extracted size will be 17.3MB for goproxy version 5.0.
|
||||
Dockerfile root of project uses multistage build and alpine project to comply with best practices. Uses golang 1.10.3 for building as noted in the project README.md and will be pretty small image. total extracted size will be 17.3MB for goproxy latest version.
|
||||
|
||||
The default build process builds the master branch (latest commits/ cutting edge), and it can be configured to build specific version, just edit Dockerfile before build, following builds release version 4.7:
|
||||
The default build process builds the master branch (latest commits/ cutting edge), and it can be configured to build specific version, just edit Dockerfile before build, following builds release version 5.2:
|
||||
|
||||
```
|
||||
ARG GOPROXY_VERSION=v5.0
|
||||
ARG GOPROXY_VERSION=v5.2
|
||||
```
|
||||
|
||||
To Run:
|
||||
@ -188,12 +188,12 @@ sudo docker build .
|
||||
```
|
||||
2. Tag the image:
|
||||
```
|
||||
sudo docker tag <id from previous step> goproxy/goproxy:latest
|
||||
sudo docker tag <id from previous step> snail007/goproxy:latest
|
||||
```
|
||||
3. Run!
|
||||
Just put your arguments to proxy binary in the OPTS environmental variable (this is just a sample http proxy):
|
||||
```
|
||||
sudo docker run -d --restart=always --name goproxy -e OPTS="http -p :33080" -p 33080:33080 goproxy/goproxy:latest
|
||||
sudo docker run -d --restart=always --name goproxy -e OPTS="http -p :33080" -p 33080:33080 snail007/goproxy:latest
|
||||
```
|
||||
4. View logs:
|
||||
```
|
||||
|
||||
@ -170,12 +170,12 @@ chmod +x install.sh
|
||||
```
|
||||
|
||||
#### Docker安装
|
||||
项目根目录的Dockerfile文件用来构建,使用golang 1.10.3,构建基于goproxy v5.1,
|
||||
项目根目录的Dockerfile文件用来构建,使用golang 1.10.3,构建基于goproxy的master分支最新版本,
|
||||
全部大小17.3MB,默认情况下使用master分支,不过可以通过修改配置文件Dockerfile
|
||||
或者使用参数GOPROXY_VERSION指定构建的goproxy版本.
|
||||
|
||||
```
|
||||
ARG GOPROXY_VERSION=v5.1
|
||||
ARG GOPROXY_VERSION=v5.2
|
||||
```
|
||||
|
||||
步骤:
|
||||
@ -185,14 +185,14 @@ sudo docker build .
|
||||
```
|
||||
2. 镜像打标签:
|
||||
```
|
||||
sudo docker tag <上一步的结果ID> goproxy/goproxy:latest
|
||||
sudo docker tag <上一步的结果ID> snail007/goproxy:latest
|
||||
```
|
||||
3. 运行
|
||||
参数OPTS的值就是传递给proxy的所有参数
|
||||
比如下面的例子启动了一个http服务:
|
||||
|
||||
```
|
||||
sudo docker run -d --restart=always --name goproxy -e OPTS="http -p :33080" -p 33080:33080 goproxy/goproxy:latest
|
||||
sudo docker run -d --restart=always --name goproxy -e OPTS="http -p :33080" -p 33080:33080 snail007/goproxy:latest
|
||||
```
|
||||
4. 查看日志:
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user