github.com/emc-advanced-dev/unik@v0.0.0-20190717152701-a58d3e8e33b7/containers/compilers/rump/python3/Dockerfile.hw (about) 1 FROM projectunik/compilers-rump-go-hw:10b309685eb8ee0f 2 3 RUN apt-get update 4 RUN apt-get install -y libsqlite3-dev libssl-dev 5 RUN mkdir -p /opt/python3 6 RUN cd /opt/python3 && git clone https://github.com/rumpkernel/rumprun-packages 7 RUN cd /opt/python3/rumprun-packages/python3 && \ 8 cp ../config.mk.dist ../config.mk && \ 9 perl -pi -e 's/RUMPRUN_TOOLCHAIN_TUPLE=/RUMPRUN_TOOLCHAIN_TUPLE=x86_64-rumprun-netbsd/g' ../config.mk && \ 10 sed -i '/\$(RUMPRUN_GENISOIMAGE) -o images\/python.iso build\/pythondist\/lib\/python3.5/d' Makefile && \ 11 export DESTDIR= && \ 12 make 13 RUN mkdir -p /python/lib 14 RUN cp -r /opt/python3/rumprun-packages/python3/build/pythondist/lib/python3.5 /python/lib/ 15 16 WORKDIR /opt 17 18 ENV RUMP_BAKE=hw_generic 19 20 COPY stub /build/stub/ 21 22 RUN set -x && cd /build/stub/ && \ 23 CC=x86_64-rumprun-netbsd-gcc CGO_ENABLED=1 GOOS=rumprun /usr/local/go/bin/go build -buildmode=c-archive -v -a -x *.go && \ 24 RUMPRUN_STUBLINK=succeed x86_64-rumprun-netbsd-gcc -g -o /build/stub/stub mainstub.c $(find . -name "*.a") 25 26 COPY python-wrapper /build/python-wrapper/ 27 28 # RUN LIKE THIS: docker run --rm -v /path/to/code:/opt/code -e MAIN_FILE=main_file.js -e BOOTSTRAP_TYPE=ec2|udp projectunik/compilers-rump-python-hw 29 CMD set -x && \ 30 (if [ -z "$MAIN_FILE" ]; then echo "Need to set MAIN_FILE"; exit 1; fi) && \ 31 (if [ -z "$BOOTSTRAP_TYPE" ]; then echo "Need to set BOOTSTRAP_TYPE"; exit 1; fi) && \ 32 cp /build/python-wrapper/python-wrapper-${BOOTSTRAP_TYPE}.py /opt/code/python-wrapper.py && \ 33 mkdir -p /opt/code/python/lib && \ 34 perl -pi -e 's/import main.py/import $ENV{MAIN_FILE}/g' /opt/code/python-wrapper.py && \ 35 cp -r /python/lib/* /opt/code/python/lib/ && \ 36 rumprun-bake $RUMP_BAKE /opt/code/program.bin /build/stub/stub /opt/python3/rumprun-packages/python3/build/python