Use go modules (#15)
This commit is contained in:
committed by
Ludovic Fernandez
parent
2bc53608e9
commit
c835c52085
@ -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
15
Gopkg.lock
generated
@ -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
|
35
Gopkg.toml
35
Gopkg.toml
@ -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
|
2
Makefile
2
Makefile
@ -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
3
go.mod
Normal file
@ -0,0 +1,3 @@
|
||||
module github.com/containous/whoami
|
||||
|
||||
require github.com/gorilla/websocket v1.2.0
|
Reference in New Issue
Block a user