Skip to content

Instantly share code, notes, and snippets.

@pepyakin
Created October 10, 2017 21:03
Show Gist options
  • Save pepyakin/6ce7c9cbb5abdd1add82f4fd52f7767f to your computer and use it in GitHub Desktop.
Save pepyakin/6ce7c9cbb5abdd1add82f4fd52f7767f to your computer and use it in GitHub Desktop.
# To build:
# docker build -t rust-bindgen-test .
#
# To run:
# docker run -v "$PWD":/build -w /build -it --rm rust-bindgen-test
#
# On macOS prefer to run with caffeinate.
FROM rust:1.20
# Update nightly and install rustfmt-nightly
RUN rustup update nightly && rustup run nightly cargo install -f rustfmt-nightly
ENV BINDGEN_JOB="test"
ENV BINDGEN_PROFILE=
ENV BINDGEN_FEATURES=
ENV LLVM_VERSION=3.8.1
ENV TRAVIS_OS_NAME=linux
ENV LIBCLANG_PATH=/root/.llvm-builds/clang+llvm-3.8.1-x86_64-linux-gnu-ubuntu-14.04/lib
# Install LLVM
COPY ./ci/before_install.sh /install/
RUN chmod +x /install/before_install.sh && bash /install/before_install.sh
VOLUME [ "/build" ]
WORKDIR /build
CMD ./ci/script.sh
rom 49a0c2264aa916b74a92aab30aeea335765899f8 Mon Sep 17 00:00:00 2001
From: Sergey Pepyakin <[email protected]>
Date: Tue, 10 Oct 2017 23:35:46 +0300
Subject: [PATCH] dockerfile.
---
.dockerignore | 3 +++
Dockerfile | 28 ++++++++++++++++++++++++++++
ci/script.sh | 4 ----
3 files changed, 31 insertions(+), 4 deletions(-)
create mode 100644 .dockerignore
create mode 100644 Dockerfile
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..c7fa3af
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,3 @@
+target
+tests/expectations/target
+.git
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..4aadbde
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,28 @@
+# To build:
+# docker build -t rust-bindgen-test .
+#
+# To run:
+# docker run -v "$PWD":/build -w /build -it --rm rust-bindgen-test
+#
+# On macOS prefer to run with caffeinate.
+
+FROM rust:1.20
+
+# Update nightly and install rustfmt-nightly
+RUN rustup update nightly && rustup run nightly cargo install -f rustfmt-nightly
+
+ENV BINDGEN_JOB="test"
+ENV BINDGEN_PROFILE=
+ENV BINDGEN_FEATURES=
+ENV LLVM_VERSION=3.8.1
+ENV TRAVIS_OS_NAME=linux
+ENV LIBCLANG_PATH=/root/.llvm-builds/clang+llvm-3.8.1-x86_64-linux-gnu-ubuntu-14.04/lib
+
+# Install LLVM
+COPY ./ci/before_install.sh /install/
+RUN chmod +x /install/before_install.sh && bash /install/before_install.sh
+
+VOLUME [ "/build" ]
+WORKDIR /build
+
+CMD ./ci/script.sh
diff --git a/ci/script.sh b/ci/script.sh
index 7338dc0..b23d8b5 100755
--- a/ci/script.sh
+++ b/ci/script.sh
@@ -11,10 +11,6 @@ export RUST_BACKTRACE=1
case "$BINDGEN_JOB" in
"test")
- # Need rustfmt to compare the test expectations.
- rustup update nightly
- rustup run nightly cargo install -f rustfmt-nightly
-
cargo test $BINDGEN_PROFILE --features "$BINDGEN_FEATURES"
./ci/assert-no-diff.sh
;;
--
2.2.1
@pepyakin
Copy link
Author

to apply patch cat dockerfile.patch | git apply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment