[go-nuts] Go install speedup within docker

2017-06-11 Thread Vladimir Varankin
Hey James,

Could you show the docker run command, which you invoke to enter a container?

I use docker to build my application as well, so I just do `docker container 
run --rm -ti --volume $PWD:/gocode/src/app --workdir /gocode/src/app 
 go build`. Doing so with container reusage or not, I 
haven't found any speed difference so far.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Go install speedup within docker

2017-06-10 Thread James Pettyjohn
I have a statically built go binary with cgo deps (wellington/go-libsass) 
which I'm trying to speed up the rebuild time for.

This is run within a docker image because so the statically compiled binary 
will run as it's own base image on docker.

The docker image the build is run within is:
FROM golang:1.8-alpine


# We need g++ for libraries like libsass
RUN apk --no-cache add g++ icu-libs make

This is the build command for the project:
go install -installsuffix docker \
-v --tags netgo --ldflags '-extldflags "-lm -lstdc++ -static"' \
org/project

Running this within the same docker instance first speeds up the build:

go install -installsuffix docker \
-v --tags netgo --ldflags '-extldflags "-lm -lstdc++ -static"' \
github.com/wellington/go-libsass


But running that doesn't speed up the overall build process as  the next 
time I run a new docker container, same folder on the host, and try to 
build the project without changing any files then it takes the full time 
again.

What could cause go install to disregard this separate build done?

Best,
James

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.