docker run -it -v `pwd`:/go/src/github.com/josecordaz/unit_tests_go_cache unittest go test -v ./...
docker build -t unittest .
Sending build context to Docker daemon 585.7kB
Step 1/3 : FROM golang:alpine
---> ccda0e5ccbfc
Step 2/3 : RUN apk add make dep git
---> Using cache
---> 21767b970e6a
Step 3/3 : WORKDIR $GOPATH/src/github.com/josecordaz/unit_tests_go_cache
---> Using cache
---> 821bb08c843a
Successfully built 821bb08c843a
Successfully tagged unittest:latest
docker run -it -v `pwd`:/go/src/github.com/josecordaz/unit_tests_go_cache unittest go test -v ./...
=== RUN TestAdd
--- PASS: TestAdd (0.00s)
PASS
ok github.com/josecordaz/unit_tests_go_cache 0.004s
Test it with
make test-no-cache
docker run -it -v `pwd`:/go/src/github.com/josecordaz/unit_tests_go_cache -v `pwd`/.cache:/root/.cache unittest go test -v ./...
docker build -t unittest .
Sending build context to Docker daemon 586.8kB
Step 1/3 : FROM golang:alpine
---> ccda0e5ccbfc
Step 2/3 : RUN apk add make dep git
---> Using cache
---> 21767b970e6a
Step 3/3 : WORKDIR $GOPATH/src/github.com/josecordaz/unit_tests_go_cache
---> Using cache
---> 821bb08c843a
Successfully built 821bb08c843a
Successfully tagged unittest:latest
docker run -it -v `pwd`:/go/src/github.com/josecordaz/unit_tests_go_cache -v `pwd`/.cache:/root/.cache unittest go test -v ./...
=== RUN TestAdd
--- PASS: TestAdd (0.00s)
PASS
ok github.com/josecordaz/unit_tests_go_cache (cached)
The message (cached) is shown in the output :D.
Test it with
make test-with-cache
Resources: