From 82677d52efa74fd3364d5dbedf643cb742f48023 Mon Sep 17 00:00:00 2001 From: Bradley Cicenas Date: Sun, 19 Mar 2017 22:39:57 +0000 Subject: [PATCH] add build section to docs --- README.md | 29 ++--------------------------- _docs/build.md | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 27 deletions(-) create mode 100644 _docs/build.md diff --git a/README.md b/README.md index 2c74ec6..871a95a 100644 --- a/README.md +++ b/README.md @@ -42,33 +42,7 @@ docker run -ti --name ctop --rm -v /var/run/docker.sock:/var/run/docker.sock qua ## Building -To build `ctop` from source, ensure you have a recent version of [glide](https://github.com/Masterminds/glide) installed and run: - -```bash -git clone https://github.com/bcicen/ctop.git $GOPATH/src/github.com/bcicen/ctop && \ -cd $GOPATH/src/github.com/bcicen/ctop && \ -make 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 -``` +Build steps can be found [here][build]. ## Usage @@ -102,4 +76,5 @@ s | Select container sort field r | Reverse container sort order q | Quit ctop +[build]: _docs/build.md [expanded_view]: _docs/expanded.md diff --git a/_docs/build.md b/_docs/build.md new file mode 100644 index 0000000..b613fdb --- /dev/null +++ b/_docs/build.md @@ -0,0 +1,20 @@ +# Build + +To build `ctop` from source, ensure you have a recent version of [glide](https://github.com/Masterminds/glide) installed and run: + +```bash +go get github.com/bcicen/ctop && \ +cd $GOPATH/src/github.com/bcicen/ctop && \ +make build +``` + +To build a minimal Docker image containing only `ctop`: +```bash +make image +``` + +Now you can run your local image: + +```bash +docker run -ti --name ctop --rm -v /var/run/docker.sock:/var/run/docker.sock ctop +```