From 5b2647fb23eaffbe48fb88bac6defaf8bfbe0f1d Mon Sep 17 00:00:00 2001 From: Mark Bates Date: Fri, 9 Aug 2019 09:15:31 -0700 Subject: [PATCH] made some improvements/updates to the base docker image (#1756) --- Dockerfile.build | 33 ++++++++++++++++++++------------- go.mod | 2 +- go.sum | 5 +++-- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/Dockerfile.build b/Dockerfile.build index 28def841e..ee362412a 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -1,32 +1,33 @@ FROM golang:latest + EXPOSE 3000 + ENV BP=$GOPATH/src/github.com/gobuffalo/buffalo ENV GOPROXY=https://proxy.golang.org RUN go version -RUN curl -sL https://deb.nodesource.com/setup_8.x | bash \ +RUN curl -sL https://deb.nodesource.com/setup_10.x | bash \ && sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' \ && wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | apt-key add - \ && apt-get update \ -&& apt-get install -y -q build-essential nodejs sqlite3 libsqlite3-dev postgresql postgresql-contrib libpq-dev mysql-client vim \ +&& apt-get install -y -q build-essential nodejs sqlite3 libsqlite3-dev postgresql postgresql-contrib libpq-dev vim \ && rm -rf /var/lib/apt/lists/* +RUN node -v +RUN npm -v + RUN service postgresql start && \ su -c "psql -c \"ALTER USER postgres WITH PASSWORD 'postgres';\"" - postgres RUN go get -u github.com/golang/dep/cmd/dep \ && go get -tags sqlite -v -u github.com/gobuffalo/pop \ +&& go get -tags sqlite -v -u github.com/gobuffalo/packr/v2/packr2 \ && go get -tags sqlite -v -u github.com/gobuffalo/buffalo-pop \ -&& go get -v -u github.com/gobuffalo/packr/packr \ -&& go get -v -u github.com/gobuffalo/packr/v2/packr2 \ -&& go get -v -u github.com/markbates/filetest \ -&& go get -v -u github.com/markbates/grift \ -&& go get -v -u github.com/markbates/refresh \ -&& rm -rfv $GOPATH/src && mkdir -p $BP +&& rm -rf $GOPATH/src && mkdir -p $BP # Install golangci -RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0 +RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0 WORKDIR $BP @@ -35,9 +36,7 @@ ADD go.sum . # preps the module cache for those using modules in their images ENV GO111MODULE=on -RUN go mod download -ENV GO111MODULE=off - +RUN go mod tidy -v RUN npm install -g --no-progress yarn \ && yarn config set yarn-offline-mirror /npm-packages-offline-cache \ @@ -45,8 +44,16 @@ RUN npm install -g --no-progress yarn \ COPY . . -RUN go get -tags sqlite -t -v ./... && packr2 && go install -v -tags sqlite ./buffalo +RUN packr2 && go install -v -tags sqlite ./buffalo RUN buffalo version +RUN mkdir -p $GOPATH/src/github.com/markbates +WORKDIR $GOPATH/src/github.com/markbates + +RUN buffalo new coke + +RUN rm -rf coke + +ENV GO111MODULE=off WORKDIR $GOPATH/src diff --git a/go.mod b/go.mod index ca58b4bd1..de6b58e20 100644 --- a/go.mod +++ b/go.mod @@ -45,7 +45,7 @@ require ( github.com/spf13/viper v1.4.0 github.com/stretchr/testify v1.3.0 golang.org/x/sync v0.0.0-20190423024810-112230192c58 - golang.org/x/tools v0.0.0-20190807223507-b346f7fd45de + golang.org/x/tools v0.0.0-20190808195139-e713427fea3f gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc gopkg.in/yaml.v2 v2.2.2 ) diff --git a/go.sum b/go.sum index 83c99bd98..343290010 100644 --- a/go.sum +++ b/go.sum @@ -24,6 +24,7 @@ github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnweb github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/cockroach-go v0.0.0-20181001143604-e0a95dfd547c h1:2zRrJWIt/f9c9HhNHAgrRgq0San5gRRUJTBXLkchal0= github.com/cockroachdb/cockroach-go v0.0.0-20181001143604-e0a95dfd547c/go.mod h1:XGLbWH/ujMcbPbhZq52Nv6UrCghb1yGn//133kEsvDk= @@ -948,8 +949,8 @@ golang.org/x/tools v0.0.0-20190613204242-ed0dc450797f/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190624180213-70d37148ca0c/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190807223507-b346f7fd45de h1:VNumCimp/Bwk6fRqgPHkjiUPZ/vzlpi23/kQTuQ4gBA= -golang.org/x/tools v0.0.0-20190807223507-b346f7fd45de/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190808195139-e713427fea3f h1:lSQQYboXWc71s9tnZRRBiMcc9Uc1BPWj3Bzvdk8UQ0Y= +golang.org/x/tools v0.0.0-20190808195139-e713427fea3f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=