Dockerfile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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:latest
  5. # Install system-level dependencies.
  6. ENV DEBIAN_FRONTEND=noninteractive
  7. RUN apt-get update -y && apt-get install -y --no-install-recommends \
  8. build-essential \
  9. ca-certificates \
  10. curl \
  11. gcc-mingw-w64-i686 \
  12. gcc-mingw-w64-x86-64 \
  13. gcc-multilib \
  14. git \
  15. mingw-w64 \
  16. mercurial \
  17. pkg-config \
  18. upx \
  19. && apt-get clean \
  20. && rm -rf /var/lib/apt/lists/*
  21. # Install Go.
  22. ENV GOVERSION=go1.5.3 GOROOT=/usr/local/go GOPATH=/go PATH=$PATH:/usr/local/go/bin:/go/bin CGO_ENABLED=1
  23. RUN curl -L https://storage.googleapis.com/golang/$GOVERSION.linux-amd64.tar.gz -o /tmp/go.tar.gz \
  24. && tar -C /usr/local -xzf /tmp/go.tar.gz \
  25. && rm /tmp/go.tar.gz \
  26. && echo $GOVERSION > $GOROOT/VERSION
  27. # Get external Go dependencies.
  28. RUN go get github.com/mitchellh/gox \
  29. && go get github.com/pwaller/goupx
  30. # Setup OpenSSL libray.
  31. ENV OPENSSL_VERSION=1.0.1p
  32. ENV PKG_CONFIG_PATH_32=/tmp/openssl/32/openssl-$OPENSSL_VERSION PKG_CONFIG_PATH_64=/tmp/openssl/64/openssl-$OPENSSL_VERSION
  33. RUN mkdir -p /tmp/openssl/32 \
  34. && mkdir -p /tmp/openssl/64 \
  35. && curl -L https://github.com/Psiphon-Labs/psiphon-tunnel-core/raw/master/openssl/openssl-$OPENSSL_VERSION.tar.gz -o /tmp/openssl.tar.gz \
  36. && tar -C /tmp/openssl/32 -xzf /tmp/openssl.tar.gz \
  37. && tar -C /tmp/openssl/64 -xzf /tmp/openssl.tar.gz \
  38. && rm /tmp/openssl.tar.gz
  39. RUN cd $PKG_CONFIG_PATH_32 \
  40. && ./Configure --cross-compile-prefix=i686-w64-mingw32- mingw \
  41. no-shared \
  42. no-ssl2 \
  43. no-ssl3 \
  44. no-comp \
  45. no-hw \
  46. no-md2 \
  47. no-md4 \
  48. no-rc2 \
  49. no-rc5 \
  50. no-krb5 \
  51. no-ripemd160 \
  52. no-idea \
  53. no-gost \
  54. no-camellia \
  55. no-seed \
  56. no-3des \
  57. no-heartbeats \
  58. && make depend \
  59. && make \
  60. && cd $PKG_CONFIG_PATH_64 \
  61. && ./Configure --cross-compile-prefix=x86_64-w64-mingw32- mingw64 \
  62. no-shared \
  63. no-ssl2 \
  64. no-ssl3 \
  65. no-comp \
  66. no-hw \
  67. no-md2 \
  68. no-md4 \
  69. no-rc2 \
  70. no-rc5 \
  71. no-krb5 \
  72. no-ripemd160 \
  73. no-idea \
  74. no-gost \
  75. no-camellia \
  76. no-seed \
  77. no-3des \
  78. no-heartbeats \
  79. && make depend \
  80. && make
  81. WORKDIR $GOPATH/src