mirror of
https://github.com/octoleo/restic.git
synced 2024-12-23 11:28:54 +00:00
Dockerfile: Install go in home dir
This allows cross-compilation with gox with Go < 1.5
This commit is contained in:
parent
e96f28c536
commit
0b12ceabe9
20
Dockerfile
20
Dockerfile
@ -22,25 +22,23 @@ ARG GOARCH=amd64
|
|||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -y --no-install-recommends ca-certificates wget git build-essential
|
RUN apt-get install -y --no-install-recommends ca-certificates wget git build-essential
|
||||||
|
|
||||||
# download and install Go
|
|
||||||
RUN wget -q -O /tmp/go.tar.gz https://storage.googleapis.com/golang/go${GOVERSION}.linux-${GOARCH}.tar.gz
|
|
||||||
RUN cd /var/lib && tar xf /tmp/go.tar.gz
|
|
||||||
RUN rm -f /tmp/go.tar.gz
|
|
||||||
|
|
||||||
ENV GOROOT /var/lib/go
|
|
||||||
ENV PATH $PATH:$GOROOT/bin
|
|
||||||
|
|
||||||
# add and configure user
|
# add and configure user
|
||||||
ENV HOME /home/travis
|
ENV HOME /home/travis
|
||||||
ENV GOPATH $HOME/gopath
|
|
||||||
ENV PATH $PATH:$GOPATH/bin
|
|
||||||
RUN useradd -m -d $HOME -s /bin/bash travis
|
RUN useradd -m -d $HOME -s /bin/bash travis
|
||||||
|
|
||||||
# run everything below as user travis
|
# run everything below as user travis
|
||||||
USER travis
|
USER travis
|
||||||
WORKDIR $HOME
|
WORKDIR $HOME
|
||||||
|
|
||||||
# make gopath
|
# download and install Go
|
||||||
|
RUN wget -q -O /tmp/go.tar.gz https://storage.googleapis.com/golang/go${GOVERSION}.linux-${GOARCH}.tar.gz
|
||||||
|
RUN tar xf /tmp/go.tar.gz && rm -f /tmp/go.tar.gz
|
||||||
|
ENV GOROOT $HOME/go
|
||||||
|
ENV PATH $PATH:$GOROOT/bin
|
||||||
|
|
||||||
|
ENV GOPATH $HOME/gopath
|
||||||
|
ENV PATH $PATH:$GOPATH/bin
|
||||||
|
|
||||||
RUN mkdir -p $GOPATH/src/github.com/restic/restic
|
RUN mkdir -p $GOPATH/src/github.com/restic/restic
|
||||||
|
|
||||||
# install tools
|
# install tools
|
||||||
|
Loading…
Reference in New Issue
Block a user