github.com/emc-advanced-dev/unik@v0.0.0-20190717152701-a58d3e8e33b7/containers/compilers/rump/go/Dockerfile.xen (about) 1 FROM projectunik/compilers-rump-base-xen:6db4e1de1235c432 2 3 RUN curl https://storage.googleapis.com/golang/go1.6.3.linux-amd64.tar.gz | tar xz -C /usr/local && \ 4 mv /usr/local/go /usr/local/go1.6 && ln -s /usr/local/go1.6 /usr/local/go && \ 5 cd /tmp && git clone https://github.com/deferpanic/gorump && cd gorump && git checkout f1d676f985f8b337b58ba4b81cf808070798be9b 6 7 8 COPY fixrump.sh /tmp/ 9 COPY patches /tmp/patches/ 10 11 RUN bash -ex /tmp/fixrump.sh 12 13 # fix go needs to be re-visited if we use go > 1.5 14 COPY fixgo.sh /tmp/ 15 COPY gopatches/ /tmp/gopatches/ 16 17 RUN cd /tmp/gorump/go1.5/src && \ 18 bash /tmp/fixgo.sh && \ 19 CGO_ENABLED=0 GOROOT_BOOTSTRAP=/usr/local/go GOOS=rumprun GOARCH=amd64 ./make.bash && \ 20 cd /tmp && mv gorump/go1.5/ /usr/local/go-patched && \ 21 rm /usr/local/go && \ 22 ln -s /usr/local/go-patched /usr/local/go 23 24 ENV RUMP_BAKE=xen_pv 25 26 27 ENV GOROOT=/usr/local/go 28 ENV GOPATH=/opt/go 29 ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin 30 31 COPY stub/ /tmp/build/ 32 33 # RUN LIKE THIS: docker run --rm -e ROOT_PATH=root_package_path -e BOOTSTRAP_TYPE=ec2|udp|gcloud|nostub -v /path/to/code:/opt/code projectunik/compilers-rump-go-xen 34 CMD set -x && \ 35 cp /tmp/build/*.go . && \ 36 mkdir -p ${GOPATH}/src/${ROOT_PATH} && \ 37 cp -r ./* ${GOPATH}/src/${ROOT_PATH} && \ 38 cd ${GOPATH}/src/${ROOT_PATH} && \ 39 GO15VENDOREXPERIMENT=1 CC=x86_64-rumprun-netbsd-gcc CGO_ENABLED=1 GOOS=rumprun /usr/local/go/bin/go build -tags ${BOOTSTRAP_TYPE} -buildmode=c-archive -v -a -x . && \ 40 cp /tmp/build/mainstub.c . && \ 41 RUMPRUN_STUBLINK=succeed x86_64-rumprun-netbsd-gcc -g -o /opt/code/program mainstub.c $(find . -name "*.a") && \ 42 rm -f /opt/code/mainstub.c /opt/code/gomaincaller.go && \ 43 bash -x $(which rumprun-bake) $RUMP_BAKE /opt/code/program.bin /opt/code/program