# Docker run -it \<image\> go install \<args\>

**URL:** <https://forums.docker.com/t/docker-run-it-image-go-install-args/31920>\
**Category:** General\
**Tags:** docker, opensource, build\
**Created:** [May 7, 2017, 12:12am UTC](https://forums.docker.com/t/docker-run-it-image-go-install-args/31920 "2017-05-07T00:12:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xuqingsz](https://avatars.discourse-cdn.com/v4/letter/x/ea666f/32.png) [@xuqingsz](https://forums.docker.com/u/xuqingsz)\
**Post date:** [May 7, 2017, 12:12am UTC](https://forums.docker.com/t/docker-run-it-image-go-install-args/31920/1 "2017-05-07T00:12:46Z")

</div>

I am building this program:

> **[hyperledger/fabric](https://github.com/hyperledger/fabric)**
>
> Read-only mirror of https://gerrit.hyperledger.org/r/#/admin/projects/fabric

The program was built successfully in one shot using the Makefile. All docker images were built as expected.

There is this line in the Makefile:  
@$(DRUN)   
-v $(abspath build/docker/bin):/opt/gopath/bin   
-v $(abspath build/docker/$(TARGET)/pkg):/opt/gopath/pkg   
hyperledger/fabric-baseimage:$(BASE\_DOCKER\_TAG)   
go install -compiler gccgo -ldflags “$(DOCKER\_GO\_LDFLAGS)” $(pkgmap.$(@F))

where  
DRUN = docker run -i --rm $(DOCKER\_RUN\_FLAGS)   
-v $(abspath .):/opt/gopath/src/$(PKGNAME)   
-w /opt/gopath/src/$(PKGNAME)

If I run this command manually with exact same , i.e.  
start the docker container (docker run)  
run the ‘go install’ command inside the container

It would not work. All object files are generated in their expected location, however, the binary cannot be generated.

In short, if I run it in one shot, it works. If I run it separately, it does not.  
I am wondering whether there are catches/caveats on using this 'Docker run go install ’ style commands? Or whether there are some debugging methods for this type of issue? Can I stop the 'Docker run go install ’ command some place in the middle?
