github.com/emc-advanced-dev/unik@v0.0.0-20190717152701-a58d3e8e33b7/containers/compilers/rump/go/Dockerfile.hw (about)

     1  FROM projectunik/compilers-rump-base-hw:8c532004d98728f4
     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=hw_generic
    25  
    26  ENV GOROOT=/usr/local/go
    27  ENV GOPATH=/opt/go
    28  ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin
    29  
    30  COPY stub/ /tmp/build/
    31  
    32  # 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
    33  CMD set -x && \
    34      cp /tmp/build/*.go . && \
    35      mkdir -p ${GOPATH}/src/${ROOT_PATH} && \
    36      cp -r ./* ${GOPATH}/src/${ROOT_PATH} && \
    37      cd ${GOPATH}/src/${ROOT_PATH} && \
    38      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 . && \
    39      cp /tmp/build/mainstub.c . && \
    40      RUMPRUN_STUBLINK=succeed x86_64-rumprun-netbsd-gcc -g -o /opt/code/program mainstub.c $(find . -name "*.a") && \
    41      rm -f /opt/code/mainstub.c /opt/code/gomaincaller.go && \
    42      bash -x $(which rumprun-bake) $RUMP_BAKE /opt/code/program.bin /opt/code/program