summaryrefslogtreecommitdiffhomepage
path: root/test/runtimes/images/Dockerfile_nodejs12.4.0
diff options
context:
space:
mode:
authorNicolas Lacasse <nlacasse@google.com>2019-09-16 17:49:57 -0700
committergVisor bot <gvisor-bot@google.com>2019-09-16 17:51:22 -0700
commit24b7eb2f86633d4b041541aa2921cc467119c1ee (patch)
tree4aa444241667a4f1bbfbeeb65d36c73970ae2d3e /test/runtimes/images/Dockerfile_nodejs12.4.0
parent56cb0042181cc4840d8c3995f0970c0c41d4212b (diff)
Refactor and clean up image tests.
* Use multi-stage builds in Dockerfiles. * Combine all proctor binaries into a single binary. * Change the TestRunner interface to reduce code duplication. PiperOrigin-RevId: 269462101
Diffstat (limited to 'test/runtimes/images/Dockerfile_nodejs12.4.0')
-rw-r--r--test/runtimes/images/Dockerfile_nodejs12.4.028
1 files changed, 28 insertions, 0 deletions
diff --git a/test/runtimes/images/Dockerfile_nodejs12.4.0 b/test/runtimes/images/Dockerfile_nodejs12.4.0
new file mode 100644
index 000000000..387824910
--- /dev/null
+++ b/test/runtimes/images/Dockerfile_nodejs12.4.0
@@ -0,0 +1,28 @@
+# Compile the proctor binary.
+FROM golang:1.12 AS golang
+ADD ["proctor/", "/go/src/proctor/"]
+RUN ["go", "build", "-o", "/proctor", "/go/src/proctor"]
+
+FROM ubuntu:bionic
+RUN apt-get update && apt-get install -y \
+ curl \
+ dumb-init \
+ g++ \
+ make \
+ python
+
+WORKDIR /root
+ARG VERSION v12.4.0
+RUN curl https://nodejs.org/dist/${VERSION}/node-${VERSION}.tar.gz
+RUN tar -zxf node-${VERSION}.tar.gz
+
+WORKDIR /root/node-${VERSION}
+RUN ./configure
+RUN make
+RUN make test-build
+
+COPY --from=golang /proctor /proctor
+
+# Including dumb-init emulates the Linux "init" process, preventing the failure
+# of tests involving worker processes.
+ENTRYPOINT ["/usr/bin/dumb-init", "/proctor", "--runtime=nodejs"]