Dockerfile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # Dockerfile to build an image with the local version of psiphon-tunnel-core.
  2. #
  3. # See README.md for usage instructions.
  4. FROM ubuntu:15.04
  5. ENV GOVERSION=go1.5.3
  6. # Install system-level dependencies.
  7. ENV DEBIAN_FRONTEND=noninteractive
  8. RUN apt-get update && apt-get -y install build-essential curl git mercurial upx gcc-mingw-w64-i686 gcc-mingw-w64-x86-64 mingw-w64 gcc-multilib pkg-config
  9. # Install Go.
  10. ENV GOROOT=/usr/local/go GOPATH=/go
  11. ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin
  12. RUN curl -L https://storage.googleapis.com/golang/$GOVERSION.linux-amd64.tar.gz -o /tmp/go.tar.gz && \
  13. tar -C /usr/local -xzf /tmp/go.tar.gz && \
  14. rm /tmp/go.tar.gz && \
  15. echo $GOVERSION > $GOROOT/VERSION
  16. ENV CGO_ENABLED=1
  17. # Get go dependencies
  18. RUN go get github.com/mitchellh/gox && go get github.com/pwaller/goupx
  19. # Setup paths for static OpenSSL libray
  20. ENV OPENSSL_VERSION=1.0.1p
  21. RUN mkdir -p /tmp/openssl/32 && mkdir -p /tmp/openssl/64 && \
  22. curl -L https://github.com/Psiphon-Labs/psiphon-tunnel-core/raw/master/openssl/openssl-$OPENSSL_VERSION.tar.gz -o /tmp/openssl.tar.gz && \
  23. tar -C /tmp/openssl/32 -xzf /tmp/openssl.tar.gz && \
  24. tar -C /tmp/openssl/64 -xzf /tmp/openssl.tar.gz
  25. ENV PKG_CONFIG_PATH_32=/tmp/openssl/32/openssl-$OPENSSL_VERSION
  26. RUN cd $PKG_CONFIG_PATH_32 && \
  27. ./Configure --cross-compile-prefix=i686-w64-mingw32- mingw \
  28. no-shared no-ssl2 no-ssl3 no-comp no-hw no-md2 no-md4 no-rc2 no-rc5 no-krb5 no-ripemd160 no-idea no-gost no-camellia no-seed no-3des no-heartbeats && \
  29. make depend && \
  30. make
  31. ENV PKG_CONFIG_PATH_64=/tmp/openssl/64/openssl-$OPENSSL_VERSION
  32. RUN cd $PKG_CONFIG_PATH_64 && \
  33. ./Configure --cross-compile-prefix=x86_64-w64-mingw32- mingw64 \
  34. no-shared no-ssl2 no-ssl3 no-comp no-hw no-md2 no-md4 no-rc2 no-rc5 no-krb5 no-ripemd160 no-idea no-gost no-camellia no-seed no-3des no-heartbeats && \
  35. make depend && \
  36. make
  37. WORKDIR $GOPATH/src