Skip to content

Commit 63aa3ef

Browse files
committed
Added glide for vendoring dependencies.
- Docker to 1.13.x
1 parent 462df02 commit 63aa3ef

File tree

6 files changed

+229
-23
lines changed

6 files changed

+229
-23
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
watchtower
2+
vendor
3+
.glide

CONTRIBUTING.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,9 @@ cd watchtower
1616
## Building and testing
1717
watchtower is a go application and is built with go commands. The following commands assume that you are at the root level of your repo.
1818
```bash
19-
go get ./... # analyzes and retrieves package dependencies
20-
go build # compiles and packages an executable binary, watchtower
21-
go test # runs tests
22-
./watchtower # runs the application (outside of a container)
19+
go get -u github.com/Masterminds/glide # installs glide for vendoring
20+
glide install # retrieves package dependencies
21+
go build # compiles and packages an executable binary, watchtower
22+
go test # runs tests
23+
./watchtower # runs the application (outside of a container)
2324
```
24-
25-
### Building the docker image
26-
watchtower is packaged and distributed as a docker image. A [golang-builder](https://github.com/CenturyLinkLabs/golang-builder) is used to package the go code and its
27-
dependencies as a minimally-sized application. The application binary is then layered into to a minimal docker image (see `Dockerfile`), so that the entire image is <10MB.
28-
See `circle.yml` for further details.The following commands assume that you are at the root level of your repo (i.e. `watchtower/`).
29-
30-
```bash
31-
docker pull centurylink/golang-builder:latest # download the builder
32-
docker run -v $(pwd):/src centurylink/golang-builder:latest # build the minimal binary
33-
docker build -t <yourfork>/watchtower:latest . # build the docker image
34-
docker run -v /var/run/docker.sock:/var/run/docker.sock <yourfork>/watchtower # run the application (inside of a container)
35-
```
36-

circle.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ machine:
55
dependencies:
66
override:
77
- docker pull centurylink/golang-builder:latest
8+
- go get -u github.com/Masterminds/glide
89

910
test:
1011
override:
12+
- glide install
1113
- docker run -v $(pwd):/src centurylink/golang-builder:latest --test

container/trust.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import (
44
"errors"
55
"os"
66
"strings"
7+
78
log "github.com/Sirupsen/logrus"
89
"github.com/docker/docker/api/types"
910
"github.com/docker/docker/api/types/reference"
1011
"github.com/docker/docker/cli/command"
11-
"github.com/docker/docker/cli/config"
12-
"github.com/docker/docker/cli/config/configfile"
13-
"github.com/docker/docker/cli/config/credentials"
12+
"github.com/docker/docker/cliconfig"
13+
"github.com/docker/docker/cliconfig/configfile"
14+
"github.com/docker/docker/cliconfig/credentials"
1415
)
1516

1617
/**
@@ -35,7 +36,7 @@ func EncodedEnvAuth(ref string) (string, error) {
3536
username := os.Getenv("REPO_USER")
3637
password := os.Getenv("REPO_PASS")
3738
if username != "" && password != "" {
38-
auth := types.AuthConfig {
39+
auth := types.AuthConfig{
3940
Username: username,
4041
Password: password,
4142
}
@@ -58,7 +59,7 @@ func EncodedConfigAuth(ref string) (string, error) {
5859
if configDir == "" {
5960
configDir = "/"
6061
}
61-
configFile, err := config.Load(configDir)
62+
configFile, err := cliconfig.Load(configDir)
6263
if err != nil {
6364
log.Errorf("Unable to find default config file %s", err)
6465
return "", err
@@ -80,7 +81,6 @@ func ParseServerAddress(ref string) (string, error) {
8081
}
8182
parts := strings.Split(repository, "/")
8283
return parts[0], nil
83-
8484
}
8585

8686
// CredentialsStore returns a new credentials store based

glide.lock

Lines changed: 186 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glide.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package: github.com/stffabi/watchtower
2+
import:
3+
- package: github.com/Sirupsen/logrus
4+
version: ~0.11.x
5+
- package: github.com/docker/docker
6+
version: ~1.13.x
7+
subpackages:
8+
- api/types
9+
- api/types/container
10+
- api/types/network
11+
- api/types/reference
12+
- cli/command
13+
- cliconfig
14+
- cliconfig/configfile
15+
- cliconfig/credentials
16+
- client
17+
- package: github.com/stretchr/testify
18+
version: ~1.1.4
19+
subpackages:
20+
- mock
21+
- package: github.com/urfave/cli
22+
version: ~1.19.1
23+
- package: golang.org/x/net
24+
repo: https://github.com/tonistiigi/net.git
25+
subpackages:
26+
- context
27+
- package: github.com/robfig/cron
28+
version: 9585fd555638e77bba25f25db5c44b41f264aeb7

0 commit comments

Comments
 (0)