Skip to content

Commit 82677d5

Browse files
committed
add build section to docs
1 parent 2b23388 commit 82677d5

File tree

2 files changed

+22
-27
lines changed

2 files changed

+22
-27
lines changed

README.md

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -42,33 +42,7 @@ docker run -ti --name ctop --rm -v /var/run/docker.sock:/var/run/docker.sock qua
4242

4343
## Building
4444

45-
To build `ctop` from source, ensure you have a recent version of [glide](https://github.com/Masterminds/glide) installed and run:
46-
47-
```bash
48-
git clone https://github.com/bcicen/ctop.git $GOPATH/src/github.com/bcicen/ctop && \
49-
cd $GOPATH/src/github.com/bcicen/ctop && \
50-
make build
51-
```
52-
53-
To build a minimal Docker image containing only `ctop`, follow the build instructions above up through `glide install`, then:
54-
55-
```bash
56-
CGO_ENABLED=0 go build -a
57-
[[ ! -d docker-build ]] && mkdir docker-build
58-
cd docker-build && cp ../ctop ./
59-
cat > Dockerfile <<- "EOF"
60-
FROM scratch
61-
COPY ./ctop /ctop
62-
ENTRYPOINT ["/ctop"]
63-
EOF
64-
docker build -t ctop .
65-
```
66-
67-
Now you can run ctop as above:
68-
69-
```bash
70-
docker run -ti --name ctop --rm -v /var/run/docker.sock:/var/run/docker.sock ctop
71-
```
45+
Build steps can be found [here][build].
7246

7347
## Usage
7448

@@ -102,4 +76,5 @@ s | Select container sort field
10276
r | Reverse container sort order
10377
q | Quit ctop
10478

79+
[build]: _docs/build.md
10580
[expanded_view]: _docs/expanded.md

_docs/build.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Build
2+
3+
To build `ctop` from source, ensure you have a recent version of [glide](https://github.com/Masterminds/glide) installed and run:
4+
5+
```bash
6+
go get github.com/bcicen/ctop && \
7+
cd $GOPATH/src/github.com/bcicen/ctop && \
8+
make build
9+
```
10+
11+
To build a minimal Docker image containing only `ctop`:
12+
```bash
13+
make image
14+
```
15+
16+
Now you can run your local image:
17+
18+
```bash
19+
docker run -ti --name ctop --rm -v /var/run/docker.sock:/var/run/docker.sock ctop
20+
```

0 commit comments

Comments
 (0)