From a55945c094d73d1359c063b55e3bcdee2f54ffac Mon Sep 17 00:00:00 2001 From: urielch Date: Sat, 13 Apr 2019 14:36:55 +0300 Subject: [PATCH] new docker test --- README.md | 4 ++-- proxy/Dockerfile | 22 +++++++++++++++------- proxy/Dockerfile.wget | 12 ++++++++++++ 3 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 proxy/Dockerfile.wget diff --git a/README.md b/README.md index e15c8b9..03c070a 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ docker build -f alpine.Dockerfile -t urielch/chrome-vnc:alpine-$(uname -m) . ### try it on a hevy website ```sh -docker run -d --rm -p 5900:5900 -e EXTRA_CHROME_OPTION="--lang=fr-FR,fr" -e X11_W=1024 -e X11_H=768 -e LANG="fr_FR.UTF-8" -e LC_ALL="fr_FR.UTF-8" -e URL=https://maps.google.fr --name chrome-ubu urielch/chrome-vnc:ubuntu-$(uname -m) +docker run -d --rm -p 5900:5900 -e EXTRA_CHROME_OPTION="--lang=fr-FR,fr" -e X11_W=1024 -e X11_H=768 -e LANG="fr_FR.UTF-8" -e LC_ALL="fr_FR.UTF-8" -e URL=https://maps.google.fr --name chrome-ubu urielch/chrome-vnc:ubuntu docker run -d --rm -p 5901:5900 -e EXTRA_CHROME_OPTION="--lang=fr-FR,fr" -e X11_W=1024 -e X11_H=768 -e LANG="fr_FR.UTF-8" -e LC_ALL="fr_FR.UTF-8" -e URL=https://maps.google.fr --name chrome-alp urielch/chrome-vnc:alpine-$(uname -m) ``` @@ -61,7 +61,7 @@ docker rmi urielch/chrome-vnc:alpine docker manifest inspect urielch/chrome-vnc:ubuntu docker manifest inspect urielch/chrome-vnc:alpine -docker manifest create --amend urielch/chrome-vnc:ubuntu urielch/chrome-vnc:ubuntu-amd64 urielch/chrome-vnc:ubuntu-armhf +docker manifest create urielch/chrome-vnc:ubuntu urielch/chrome-vnc:ubuntu-amd64 urielch/chrome-vnc:ubuntu-armhf urielch/chrome-vnc:ubuntu-aarch64 docker manifest create --amend urielch/chrome-vnc:alpine urielch/chrome-vnc:alpine-amd64 urielch/chrome-vnc:alpine-armhf diff --git a/proxy/Dockerfile b/proxy/Dockerfile index dfcb268..6b43788 100644 --- a/proxy/Dockerfile +++ b/proxy/Dockerfile @@ -1,11 +1,19 @@ -FROM golang as builder +FROM golang:1.11 as builder + WORKDIR /root/ -RUN FILE=proxy-$(go env GOOS)-$(go env GOARCH).tar.gz && \ - wget https://github.com/snail007/goproxy/releases/download/v7.3/$FILE -O $FILE && \ - tar -xvzf $FILE && \ - rm $FILE +RUN go get golang.org/x/time/rate && \ + mkdir -p /go/src/github.com/snail007/ && \ + cd /go/src/github.com/snail007/ && \ + git clone https://github.com/snail007/goproxy.git && \ + cd goproxy && \ + sed -i 's@"proxy/@"github.com/snail007/goproxy/@g' config.go main.go services/*.go && \ + CGO_ENABLED=0 go get . && \ + cp auth-file blocked direct /go/bin + FROM alpine:latest WORKDIR /root/ -COPY --from=builder /root/* /root/ -ENTRYPOINT [ "proxy" ] +COPY --from=builder /go/bin/* /root/ + +ENTRYPOINT [ "./goproxy"] + diff --git a/proxy/Dockerfile.wget b/proxy/Dockerfile.wget new file mode 100644 index 0000000..bfe50f5 --- /dev/null +++ b/proxy/Dockerfile.wget @@ -0,0 +1,12 @@ +FROM golang as builder +WORKDIR /root/ +RUN FILE=proxy-$(go env GOOS)-$(go env GOARCH).tar.gz && \ + wget https://github.com/snail007/goproxy/releases/download/v7.3/$FILE -O $FILE && \ + tar -xvzf $FILE && \ + rm $FILE + +FROM alpine:latest +WORKDIR /root/ +COPY --from=builder /root/* /root/ +CMD [ "/bin/sh" ] +#ENTRYPOINT [ "./proxy" ]