Fix reuse of compy folder

Previously, compy was moved to `/go/src/...` but default GOPATH was created as `/root/go`, so compy was downloaded from Github on each build instead of using locally existing copy.
This commit is contained in:
Ingvar Stepanyan 2018-04-28 20:12:24 +01:00 committed by Andrew Gaul
parent 455a570e9c
commit 6b79234669

View file

@ -13,9 +13,9 @@ RUN mkdir -p /usr/local/ && \
curl -O https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz && \ curl -O https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz && \
tar xf go1.9.linux-amd64.tar.gz -C /usr/local tar xf go1.9.linux-amd64.tar.gz -C /usr/local
RUN mkdir -p /go/src/github.com/barnacs/compy/ RUN mkdir -p /root/go/src/github.com/barnacs/compy/
COPY . /go/src/github.com/barnacs/compy/ COPY . /root/go/src/github.com/barnacs/compy/
WORKDIR /go/src/github.com/barnacs/compy WORKDIR /root/go/src/github.com/barnacs/compy
RUN /usr/local/go/bin/go get -d -v ./... RUN /usr/local/go/bin/go get -d -v ./...
RUN /usr/local/go/bin/go build -v RUN /usr/local/go/bin/go build -v
@ -34,8 +34,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
WORKDIR /opt/compy WORKDIR /opt/compy
COPY \ COPY \
--from=compy-builder \ --from=compy-builder \
/go/src/github.com/barnacs/compy/compy \ /root/go/src/github.com/barnacs/compy/compy \
/go/src/github.com/barnacs/compy/docker.sh \ /root/go/src/github.com/barnacs/compy/docker.sh \
/opt/compy/ /opt/compy/
# TODO: configure HTTP BASIC authentication # TODO: configure HTTP BASIC authentication