371967f791
By using npm ci, we can make sure the versions of the helper libraries (e.g. Karma, Jasmine) we are testing with locally is the same as the versions we are using in the continuous integration system. The copying is needed because our docker recipe forces us to run as not root, and this was causing some issues. As a result, I changed the canvaskit test/perf to not re-use the same file as pathkit does so copying was easier and the dependencies between the two modules is broken. Bug: skia:11077 Change-Id: Ib05890d666d3507d4f724a4ae298484629c7932a Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343503 Reviewed-by: Kevin Lubick <kjlubick@google.com>
32 lines
1.2 KiB
Docker
32 lines
1.2 KiB
Docker
# Docker container with Chrome, and karma/jasmine, to be used to run JS tests.
|
|
# Inspired by https://github.com/eirslett/chrome-karma-docker
|
|
#
|
|
# Tests will be run as non-root (user skia, in fact), so /OUT should have permissions
|
|
# 777 so as to be able to create output there.
|
|
|
|
FROM node:14.15
|
|
|
|
RUN apt-get update && apt-get upgrade -y
|
|
|
|
RUN wget https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64.deb
|
|
RUN dpkg -i dumb-init_*.deb
|
|
|
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
|
|
|
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
|
|
RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
|
|
RUN apt-get update && apt-get install -y google-chrome-stable
|
|
|
|
#Add user so we don't have to run as root (prevents us from over-writing files in /SRC)
|
|
RUN groupadd -g 2000 skia \
|
|
&& useradd -u 2000 -g 2000 skia \
|
|
&& mkdir -p /home/skia \
|
|
&& chown -R skia:skia /home/skia
|
|
|
|
# These directories can be used for mounting a source checkout and having a place to put outputs.
|
|
RUN mkdir -m 0777 /SRC /OUT
|
|
|
|
# Run everything after as non-privileged user.
|
|
USER skia
|
|
|
|
WORKDIR /home/skia |