Skip to content

Commit 5005e05

Browse files
authored
Merge pull request linuxkit#3595 from deitch/gomodules-docs
update docs
2 parents 80c4edd + 4e23d08 commit 5005e05

File tree

1 file changed

+16
-40
lines changed

1 file changed

+16
-40
lines changed

docs/vendoring.md

Lines changed: 16 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,34 @@ Vendoring
22
=========
33

44
The Go code in this repo depends on a number of Go libraries.
5-
These are vendored in to the `src/cmd/linuxkit/vendor` directory using [`vndr`](https://github.com/lk4d4/vndr)
6-
The `vendor.conf` file contains a list of the repositories and the git SHA or branch name that should be vendored
5+
These are vendored in to the `src/cmd/linuxkit/vendor` directory using [go modules](https://golang.org/ref/mod)
76

87
## Updating dependencies
98

10-
Update `src/cmd/linuxkit/vendor.conf` with the dependency that you would like to add.
11-
Details of usage of the `vndr` tool and the format of `vendor.conf` can be found [here](https://github.com/LK4D4/vndr/blob/master/README.md)
9+
Go modules should install any required dependencies to `go.mod` and `go.sum` when running normal go commands such as `go build`,
10+
`go vet`, etc. To install specific versions, use `go get <dependency>@<reference>`.
1211

13-
Once done, you must run the `vndr` tool to add the necessary files to the `vendor` directory.
14-
The easiest way to do this is in a container.
12+
See the [go modules](https://golang.org/ref/mod) documentation for more information.
1513

16-
## Updating in a container
14+
LinuxKit vendors all dependencies to make it completely self-contained. Once `go.mod` is up to date,
15+
you must update the dependencies, either using your local go toolchain or in a container.
1716

18-
To update all dependencies:
17+
## Updating locally
1918

20-
```
21-
docker run -it --rm \
22-
-v $(pwd):/go/src/github.com/linuxkit/linuxkit \
23-
-w /go/src/github.com/linuxkit/linuxkit/src/cmd/linuxkit \
24-
--entrypoint /go/bin/vndr \
25-
linuxkit/go-compile:b1446b2ba407225011f97ae1dba0f512ae7f9b84
26-
```
19+
To vendor all dependencies:
2720

28-
To update a single dependency:
21+
1. `cd src/cmd/linuxkit`
22+
1. Run `go mod vendor`
23+
24+
## Updating in a container
25+
26+
To update all dependencies:
2927

3028
```
3129
docker run -it --rm \
3230
-v $(pwd):/go/src/github.com/linuxkit/linuxkit \
3331
-w /go/src/github.com/linuxkit/linuxkit/src/cmd/linuxkit \
34-
--entrypoint /go/bin/vndr \
32+
--entrypoint=go
3533
linuxkit/go-compile:b1446b2ba407225011f97ae1dba0f512ae7f9b84
36-
github.com/docker/docker
37-
```
38-
39-
## Updating locally
40-
41-
First you must install `vndr` and ensure that `$GOPATH/bin` is on your `$PATH`
42-
43-
```
44-
go get -u github.com/LK4D4/vndr
45-
```
46-
47-
To update all dependencies:
48-
49-
```
50-
cd src/cmd/linuxkit
51-
vndr
52-
```
53-
54-
To update a single dependency:
55-
56-
```
57-
cd /src/cmd/linuxkit
58-
vndr github.com/docker/docker
34+
mod vendor
5935
```

0 commit comments

Comments
 (0)