mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
Add minimal Docker image build instructions
Update README to include instructions for building from source a minimal Docker image with only ctop.
This commit is contained in:
parent
e2bc4d0a08
commit
19b212f45d
20
README.md
20
README.md
@ -53,6 +53,26 @@ glide install && \
|
||||
go build
|
||||
```
|
||||
|
||||
To build a minimal Docker image containing only `ctop`, follow the build instructions above up through `glide install`, then:
|
||||
|
||||
```bash
|
||||
CGO_ENABLED=0 go build -a
|
||||
[[ ! -d docker-build ]] && mkdir docker-build
|
||||
cd docker-build && cp ../ctop ./
|
||||
cat > Dockerfile <<- "EOF"
|
||||
FROM scratch
|
||||
COPY ./ctop /ctop
|
||||
ENTRYPOINT ["/ctop"]
|
||||
EOF
|
||||
docker build -t ctop .
|
||||
```
|
||||
|
||||
Now you can run ctop as above:
|
||||
|
||||
```bash
|
||||
docker run -ti --name ctop --rm -v /var/run/docker.sock:/var/run/docker.sock ctop
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
`ctop` requires no arguments and will configure itself using the `DOCKER_HOST` environment variable
|
||||
|
Loading…
Reference in New Issue
Block a user