fix docker pre-fetch of go modules

Signed-off-by: Morgan Tocker <tocker@gmail.com>
This commit is contained in:
Morgan Tocker 2019-09-06 14:57:28 -06:00
Родитель 18e0e98275
Коммит 0b191d648a
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -52,19 +52,21 @@ ENV USER vitess
ENV GO111MODULE on
# Copy files needed for bootstrap
COPY bootstrap.sh dev.env build.env /vt/src/vitess.io/vitess/
COPY bootstrap.sh dev.env build.env go.mod go.sum /vt/src/vitess.io/vitess/
COPY config /vt/src/vitess.io/vitess/config
COPY third_party /vt/src/vitess.io/vitess/third_party
COPY tools /vt/src/vitess.io/vitess/tools
COPY travis /vt/src/vitess.io/vitess/travis
RUN go mod download
# Create vitess user
RUN groupadd -r vitess && useradd -r -g vitess vitess && \
mkdir -p /vt/vtdataroot /home/vitess && \
chown -R vitess:vitess /vt /home/vitess
# Download vendored Go dependencies
RUN cd /vt/src/vitess.io/vitess && \
su vitess -c "/usr/local/go/bin/go mod download"
# Create mount point for actual data (e.g. MySQL data dir)
VOLUME /vt/vtdataroot