From d9f93a208d309d34bbfd91a154503f90b1cfe4a5 Mon Sep 17 00:00:00 2001 From: Moritz Raho Date: Fri, 26 Oct 2018 12:47:17 +0200 Subject: [PATCH] fixed Dockerfile build fail, go error config_supervisor --- Dockerfile | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 338595b..ce559fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -178,27 +178,23 @@ RUN echo " ... installing lua-resty-iputils..." \ && rm -rf /tmp/api-gateway ENV CONFIG_SUPERVISOR_VERSION 1.0.3 -ENV GOPATH /usr/lib/go/bin +ENV GOPATH /tmp/go ENV GOBIN /usr/lib/go/bin ENV PATH $PATH:/usr/lib/go/bin RUN echo " ... installing api-gateway-config-supervisor ... " \ && echo "http://dl-4.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \ && apk update \ && apk add gcc make git 'go' \ - && mkdir -p /tmp/api-gateway \ + && mkdir -p /tmp/api-gateway /usr/local/sbin \ && curl -L https://github.com/adobe-apiplatform/api-gateway-config-supervisor/archive/${CONFIG_SUPERVISOR_VERSION}.tar.gz -o /tmp/api-gateway/api-gateway-config-supervisor-${CONFIG_SUPERVISOR_VERSION}.tar.gz \ && cd /tmp/api-gateway \ && tar -xf /tmp/api-gateway/api-gateway-config-supervisor-${CONFIG_SUPERVISOR_VERSION}.tar.gz \ - && mkdir -p /tmp/go \ - && mv /tmp/api-gateway/api-gateway-config-supervisor-${CONFIG_SUPERVISOR_VERSION}/* /tmp/go \ - && cd /tmp/go \ + && mkdir -p ${GOPATH}/src/github.com/adobe-apiplatform/api-gateway-config-supervisor/ \ + && mv /tmp/api-gateway/api-gateway-config-supervisor-${CONFIG_SUPERVISOR_VERSION}/* ${GOPATH}/src/github.com/adobe-apiplatform/api-gateway-config-supervisor/ \ + && cd ${GOPATH}/src/github.com/adobe-apiplatform/api-gateway-config-supervisor/ \ && make setup \ - && mkdir -p /tmp/go/Godeps/_workspace \ - && ln -s /tmp/go/vendor /tmp/go/Godeps/_workspace/src \ - && mkdir -p /tmp/go-src/src/github.com/adobe-apiplatform \ - && ln -s /tmp/go /tmp/go-src/src/github.com/adobe-apiplatform/api-gateway-config-supervisor \ - && GOPATH=/tmp/go/vendor:/tmp/go-src CGO_ENABLED=0 GOOS=linux /usr/lib/go/bin/godep go build -ldflags "-s" -a -installsuffix cgo -o api-gateway-config-supervisor ./ \ - && mv /tmp/go/api-gateway-config-supervisor /usr/local/sbin/ \ + && godep go build -ldflags "-s" -a -installsuffix cgo -o api-gateway-config-supervisor ./ \ + && mv ./api-gateway-config-supervisor /usr/local/sbin/ \ && echo "installing rclone sync ... skipped due to https://github.com/ncw/rclone/issues/663 ... " \ # && go get github.com/ncw/rclone \