mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-10-30 10:46:54 +00:00
I noticed that running the runes in docs/vendoring.md made a bunch of files which are omitted by modern vndr come back, presumably due to the old version of vndr referenced there. So update the go-compile package to the current version everywhere. Also correct the use of `make` variable syntax (`$(PWD)`) where shell syntax command substitution for `pwd` was desired. Signed-off-by: Ian Campbell <ijc@docker.com>
60 lines
1.5 KiB
Markdown
60 lines
1.5 KiB
Markdown
Vendoring
|
|
=========
|
|
|
|
The Go code in this repo depends on a number of Go libraries.
|
|
These are vendored in to the `src/cmd/linuxkit/vendor` directory using [`vndr`](https://github.com/lk4d4/vndr)
|
|
The `vendor.conf` file contains a list of the repositories and the git SHA or branch name that should be vendored
|
|
|
|
## Updating dependencies
|
|
|
|
Update `src/cmd/linuxkit/vendor.conf` with the dependency that you would like to add.
|
|
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)
|
|
|
|
Once done, you must run the `vndr` tool to add the necessary files to the `vendor` directory.
|
|
The easiest way to do this is in a container.
|
|
|
|
## Updating in a container
|
|
|
|
To update all dependencies:
|
|
|
|
```
|
|
docker run -it --rm \
|
|
-v $(pwd):/go/src/github.com/linuxkit/linuxkit \
|
|
-w /go/src/github.com/linuxkit/linuxkit/src/cmd/linuxkit \
|
|
--entrypoint /go/bin/vndr \
|
|
linuxkit/go-compile:a1e3cd3a54b1ad683b555655282272d0eb27ee40
|
|
```
|
|
|
|
To update a single dependency:
|
|
|
|
```
|
|
docker run -it --rm \
|
|
-v $(pwd):/go/src/github.com/linuxkit/linuxkit \
|
|
-w /go/src/github.com/linuxkit/linuxkit/src/cmd/linuxkit \
|
|
--entrypoint /go/bin/vndr \
|
|
linuxkit/go-compile:a1e3cd3a54b1ad683b555655282272d0eb27ee40
|
|
github.com/docker/docker
|
|
```
|
|
|
|
## Updating locally
|
|
|
|
First you must install `vndr` and ensure that `$GOPATH/bin` is on your `$PATH`
|
|
|
|
```
|
|
go get -u github.com/LK4D4/vndr
|
|
```
|
|
|
|
To update all dependencies:
|
|
|
|
```
|
|
cd src/cmd/linuxkit
|
|
vndr
|
|
```
|
|
|
|
To update a single dependency:
|
|
|
|
```
|
|
cd /src/cmd/linuxkit
|
|
vndr github.com/docker/docker
|
|
```
|