Use go modules (#15)

This commit is contained in:
Alan Scherger
2019-01-09 16:58:52 -06:00
committed by Ludovic Fernandez
parent 2bc53608e9
commit c835c52085
6 changed files with 9 additions and 56 deletions

View File

@ -1,12 +1,10 @@
FROM golang:1.10 as builder
WORKDIR /go/src/github.com/containous/whoami
FROM golang:1.11 as builder
WORKDIR /go/whoami
COPY . .
RUN go get -u github.com/golang/dep/cmd/dep
RUN make dependencies
RUN make build
# Create a minimal container to run a Golang static binary
FROM scratch
COPY --from=builder /go/src/github.com/containous/whoami/whoami .
COPY --from=builder /go/whoami/whoami .
ENTRYPOINT ["/whoami"]
EXPOSE 80

15
Gopkg.lock generated
View File

@ -1,15 +0,0 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/gorilla/websocket"
packages = ["."]
revision = "ea4d1f681babbce9545c9c5f3d5194a789c89f5b"
version = "v1.2.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "941e8dbe52e16e8a7dff4068b7ba53ae69a5748b29fbf2bcb5df3a063ac52261"
solver-name = "gps-cdcl"
solver-version = 1

View File

@ -1,35 +0,0 @@
# Gopkg.toml example
#
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true
[[constraint]]
name = "github.com/gorilla/websocket"
version = "1.2.0"
[prune]
non-go = true
go-tests = true
unused-packages = true

View File

@ -6,7 +6,7 @@ build:
CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags="-s" -o whoami
dependencies:
dep ensure -v
go mod download
image:
docker build -t containous/whoami .

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module github.com/containous/whoami
require github.com/gorilla/websocket v1.2.0

2
go.sum Normal file
View File

@ -0,0 +1,2 @@
github.com/gorilla/websocket v1.2.0 h1:VJtLvh6VQym50czpZzx07z/kw9EgAxI3x1ZB8taTMQQ=
github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=