-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
42 lines (31 loc) · 1.18 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# download and replace the latest swagger spec for docker engine
# not used yet. The latest swagger causes some problems in cli generate
sync-swagger:
curl https://raw.githubusercontent.com/docker/engine/master/api/swagger.yaml -o api/swagger.yaml
build-container:
docker build -t dockerctl:dev -f dev/Dockerfile .
generate:
swagger generate cli --target=. --spec=api/swagger.yaml --cli-app-name dockerctl
generate-completion:
cmd/dockerctl/dockerctl completion bash > cmd/completion/dockerctl.bash-completion.sh
clean-generate:
rm -rf cli client models cmd/dockerctl
build:
CGO_ENABLED=0 go build -o cmd/dockerctl/dockerctl cmd/dockerctl/main.go
install:
cp cmd/dockerctl/dockerctl /usr/local/bin/dockerctl
cp cmd/completion/dockerctl.bash-completion.sh /etc/bash_completion.d/dockerctl
clean:
rm -f cmd/dockerctl/dockerctl
dind-start:
docker run --privileged --name dind -d \
--network docker --network-alias docker \
-v ${PWD}:/repo -w /repo \
dockerctl:dev
dind-stop:
docker container stop dind
docker container rm dind
shell:
docker exec -it dind bash
expose-docker:
socat TCP-LISTEN:12345,bind=127.0.0.1,reuseaddr,fork,range=127.0.0.0/8 UNIX-CLIENT:/var/run/docker.sock &