mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-13 21:56:38 +01:00
Added glide for vendoring dependencies.
- Docker to 1.13.x
This commit is contained in:
parent
462df027f5
commit
63aa3efb11
6 changed files with 229 additions and 23 deletions
|
|
@ -16,21 +16,9 @@ cd watchtower
|
|||
## Building and testing
|
||||
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.
|
||||
```bash
|
||||
go get ./... # analyzes and retrieves package dependencies
|
||||
go build # compiles and packages an executable binary, watchtower
|
||||
go test # runs tests
|
||||
./watchtower # runs the application (outside of a container)
|
||||
go get -u github.com/Masterminds/glide # installs glide for vendoring
|
||||
glide install # retrieves package dependencies
|
||||
go build # compiles and packages an executable binary, watchtower
|
||||
go test # runs tests
|
||||
./watchtower # runs the application (outside of a container)
|
||||
```
|
||||
|
||||
### Building the docker image
|
||||
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
|
||||
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.
|
||||
See `circle.yml` for further details.The following commands assume that you are at the root level of your repo (i.e. `watchtower/`).
|
||||
|
||||
```bash
|
||||
docker pull centurylink/golang-builder:latest # download the builder
|
||||
docker run -v $(pwd):/src centurylink/golang-builder:latest # build the minimal binary
|
||||
docker build -t <yourfork>/watchtower:latest . # build the docker image
|
||||
docker run -v /var/run/docker.sock:/var/run/docker.sock <yourfork>/watchtower # run the application (inside of a container)
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue