Skip to content

Instantly share code, notes, and snippets.

@hayd

hayd/Dockerfile Secret

Created November 1, 2019 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hayd/e6d3efbf1bc2fcecbd0ef50e3245e928 to your computer and use it in GitHub Desktop.
Save hayd/e6d3efbf1bc2fcecbd0ef50e3245e928 to your computer and use it in GitHub Desktop.
#FROM amazonlinux:2017.03.1.20170812
FROM amazonlinux:2018.03.0.20191014.0
# trying to build deno on Amazon Linux 1
RUN yum install -y curl unzip
# Note: 1.9.0 does not run without glibc.
ENV NINJA_VERSION=1.8.2
RUN curl -fsSL https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/ninja-linux.zip --output ninja.zip \
&& unzip ninja.zip \
&& mv ninja /bin/ninja \
&& rm ninja.zip
# TODO specify a version of gn here rather than "latest"
RUN curl -fL https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+/latest --output gn.zip \
&& unzip gn.zip gn \
&& mv gn /bin/gn \
&& rm gn.zip
# TODO specify the version here rather than "stable"
RUN curl https://sh.rustup.rs -sSf | \
sh -s -- --default-toolchain stable -y
ENV PATH=/root/.cargo/bin:$PATH
ENV DENO_BUILD_MODE=release
ENV DENO_VERSION 0.22.0
RUN curl -fsSL https://github.com/denoland/deno/releases/download/v${DENO_VERSION}/deno_src.tar.gz --output deno.tar.gz \
&& tar -zxf deno.tar.gz \
&& rm deno.tar.gz
RUN cp /bin/gn /deno/core/libdeno/buildtools/linux64/gn
RUN yum install -y git
# libcxx version 8.0.1
# ENV LIBCXX_COMMIT=18537123c4eee3e3905e99f12ca772978480b37e
# libcxx version 9.0.1
ENV LIBCXX_COMMIT=2076f539f410805ef88692b9c0ce0a0b882a7680
RUN git clone https://github.com/llvm-mirror/libcxx.git /tmp/libcxx \
&& git -C /tmp/libcxx checkout ${LIBCXX_COMMIT}
RUN curl -fL http://releases.llvm.org/9.0.0/clang+llvm-9.0.0-x86_64-linux-sles11.3.tar.xz --output /tmp/clang.tar.xz \
&& tar xf /tmp/clang.tar.xz -C /tmp \
&& rm /tmp/clang.tar.xz
ENV PATH=/tmp/clang+llvm-9.0.0-x86_64-linux-sles11.3/bin:$PATH
WORKDIR /deno/cli
RUN yum install -y gcc-c++
RUN CPATH=/tmp/libcxx/includes RUST_BACKTRACE=1 DENO_NO_BINARY_DOWNLOAD=1 DENO_BUILD_ARGS='clang_use_chrome_plugins=false treat_warnings_as_errors=false use_sysroot=false clang_base_path="/usr" use_glib=false use_custom_libcxx=false use_custom_libcxx_for_host=false use_gold=true' DENO_GN_PATH=gn cargo install --locked --root .. --path . \
|| echo error
ENTRYPOINT ["/bin/bash"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment