You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding a Dockerfile and making it easy to use it for dev
Credit goes to dperny (#2687)
**- What I did**
Adds a Dockerfile for the swarmkit project, to easily get off the ground. Modifies the Makefile to make intelligent use of Docker.
Also made small clean up changes to the Makefile.
**- How I did it**
Modifies the Makefile to have two paths: containerized.mk, which builds the docker image and forwards any make targets to a container, and direct.mk, which encompasses the old Makefile's workflow.
By default, nothing will run inside a container. Set the environment variable `DOCKER_SWARMKIT_USE_CONTAINER` to use dockerized making.
Also leverages docker-sync for synchronizing code to the container if the `DOCKER_SWARMKIT_USE_DOCKER_SYNC` env variable is set; comes in handy on Macs, for example.
**- How to test it**
Set `DOCKER_SWARMKIT_USE_CONTAINER` and verify that your favorite make targets all work!
Signed-off-by: Jean Rouge <[email protected]>
Copy file name to clipboardexpand all lines: Makefile
+12-133
Original file line number
Diff line number
Diff line change
@@ -24,136 +24,15 @@ VNDR=$(shell which vndr || echo '')
24
24
25
25
GO_LDFLAGS=-ldflags "-X `go list ./version`.Version=$(VERSION)"
26
26
27
-
.PHONY: clean all AUTHORS fmt vet lint build binaries test integration setup generate protos checkprotos coverage ci check help install uninstall dep-validate
28
-
.DEFAULT: default
29
-
30
-
all: check binaries test integration ## run fmt, vet, lint, build the binaries and run the tests
31
-
32
-
check: fmt vet lint ineffassign misspell ## run fmt, vet, lint, ineffassign, misspell
33
-
34
-
ci: check binaries checkprotos coverage coverage-integration ## to be used by the CI
35
-
36
-
AUTHORS: .mailmap .git/HEAD
37
-
git log --format='%aN <%aE>'| sort -fu >$@
38
-
39
-
# This only needs to be generated by hand when cutting full releases.
40
-
version/version.go:
41
-
./version/version.sh >$@
42
-
43
-
setup: ## install dependencies
44
-
@echo "🐳 $@"
45
-
# TODO(stevvooe): Install these from the vendor directory
46
-
@go get -u github.com/golang/lint/golint
47
-
#@go get -u github.com/kisielk/errcheck
48
-
@go get -u github.com/gordonklaus/ineffassign
49
-
@go get -u github.com/client9/misspell/cmd/misspell
50
-
@go get -u github.com/lk4d4/vndr
51
-
@go get -u github.com/stevvooe/protobuild
52
-
53
-
generate: protos
54
-
@echo "🐳 $@"
55
-
@PATH=${ROOTDIR}/bin:${PATH} go generate -x ${PACKAGES}
checkprotos: generate ## check if protobufs needs to be generated again
62
-
@echo "🐳 $@"
63
-
@test -z "$$(git status --short | grep ".pb.go" | tee /dev/stderr)"||\
64
-
((git diff | cat) && \
65
-
(echo "👹 please run 'make generate' when making changes to proto files"&& false))
66
-
67
-
# Depends on binaries because vet will silently fail if it can't load compiled
68
-
# imports
69
-
vet: binaries ## run go vet
70
-
@echo "🐳 $@"
71
-
@test -z "$$(go vet ${PACKAGES} 2>&1 | grep -v 'constant [0-9]* not a string in call to Errorf' | egrep -v '(timestamp_test.go|duration_test.go|exit status 1)' | tee /dev/stderr)"
checkprotos: generate ## check if protobufs needs to be generated again
42
+
@echo "🐳 $@"
43
+
@test -z "$$(git status --short | grep ".pb.go" | tee /dev/stderr)"||\
44
+
((git diff | cat) && \
45
+
(echo "👹 please run 'make generate' when making changes to proto files"&& false))
46
+
47
+
# Depends on binaries because vet will silently fail if it can't load compiled
48
+
# imports
49
+
.PHONY: vet
50
+
vet: binaries ## run go vet
51
+
@echo "🐳 $@"
52
+
@test -z "$$(go vet ${PACKAGES} 2>&1 | grep -v 'constant [0-9]* not a string in call to Errorf' | egrep -v '(timestamp_test.go|duration_test.go|exit status 1)' | tee /dev/stderr)"
0 commit comments