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

Commit

Permalink
Task fixing slim dockerfile (#1750)
Browse files Browse the repository at this point in the history
* fixing our slim image dockerfile to be built with modules and use the golang proxy

* simplifying env expressions

* moving to use GOPROXY by default

* enabling proxy for the tests
  • Loading branch information
paganotoni authored Aug 7, 2019
1 parent 7d9c0c5 commit d879975
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM gobuffalo/buffalo:latest
ENV GOPROXY=https://proxy.golang.org

ARG CODECOV_TOKEN

Expand Down
2 changes: 2 additions & 0 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
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 \
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile.slim.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM golang:alpine
EXPOSE 3000
ENV BP=$GOPATH/src/github.com/gobuffalo/buffalo
ENV GOPROXY=https://proxy.golang.org

RUN apk add --no-cache --upgrade apk-tools \
&& apk add --no-cache bash curl openssl git build-base nodejs npm postgresql libpq postgresql-contrib sqlite sqlite-dev mysql-client vim

Expand Down Expand Up @@ -34,7 +36,9 @@ RUN rm -rfv $BP && mkdir -p $BP
WORKDIR $BP

COPY . .
ENV GO111MODULE=on
RUN make deps && make install
ENV GO111MODULE=

RUN buffalo version

Expand Down
1 change: 1 addition & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
variables:
GOBIN: "$(GOPATH)/bin" # Go binaries path
GOPATH: "$(system.defaultWorkingDirectory)/gopath" # Go workspace path
GOPROXY: "https://proxy.golang.org"
modulePath: "$(GOPATH)/src/github.com/$(build.repository.name)" # Path to the module"s code

jobs:
Expand Down

0 comments on commit d879975

Please sign in to comment.