Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Used the mounted path as the GOPATH
Browse files Browse the repository at this point in the history
  • Loading branch information
sindbach committed Dec 15, 2020
1 parent ba81879 commit 02e3b43
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@ RUN apt-get update && apt-get install -y \
rm -rf /var/lib/apt/lists/*

RUN export uid=1000 gid=1000 && \
mkdir -p /home/ubuntu && \
mkdir -p /home/ubuntu && mkdir /workspace && \
echo "ubuntu:x:${uid}:${gid}:Developer,,,:/home/ubuntu:/bin/bash" >> /etc/passwd && \
echo "ubuntu:x:${uid}:" >> /etc/group && \
echo "ubuntu ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/ubuntu && \
chmod 0440 /etc/sudoers.d/ubuntu && \
chown ${uid}:${gid} -R /home/ubuntu

ENV HOME /home/ubuntu
ENV WORKSPACE /workspace
ENV GOROOT "/usr/local/go"
ENV GOPATH ${HOME}
ENV GOPATH ${WORKSPACE}
ENV PATH "$PATH:$GOPATH/bin:$GOROOT/bin"

WORKDIR ${HOME}
WORKDIR ${WORKSPACE}

RUN wget --quiet https://dl.google.com/go/go1.15.3.linux-amd64.tar.gz \
&& tar -xf go1.15.3.linux-amd64.tar.gz \
Expand All @@ -34,7 +35,6 @@ RUN wget --quiet https://dl.google.com/go/go1.15.3.linux-amd64.tar.gz \
ENV DRIVER_VERSION ${DRIVER_VERSION}
ENV MONGODB_URI ${MONGODB_URI}

RUN mkdir -p ${HOME}/go && mkdir /workspace
COPY ./go/getstarted.go ${HOME}/go/getstarted.go
COPY ./go/go.mod ${HOME}/go/go.mod

Expand Down

0 comments on commit 02e3b43

Please sign in to comment.