-
Notifications
You must be signed in to change notification settings - Fork 27
/
Dockerfile.github-actions
54 lines (47 loc) · 2.32 KB
/
Dockerfile.github-actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# More info: https://hub.docker.com/repository/docker/wyeworkshub/ruby-node-chrome-pack/general
#
# To build with specific versions of bundler or node, pass in a build arg.
# You can set these explicitly:
# `--build-arg NODE_VERSION=setup_18.x`
# Also, if the variable is already set in your local environment, you can just pass in:
# `--build-arg BUNDLER_VERSION`
# ... and `docker build` will pick up the local value.
#
# Example usage:
# build . -f Dockerfile.github-actions --build-arg NODE_VERSION=setup_18.x --build-arg BUNDLER_VERSION
FROM --platform=linux/amd64 ruby:3.3.0 as base
# Install NodeJS based on https://github.com/nodesource/distributions#installation-instructions
ARG NODE_VERSION=setup_16.x
ENV NODE_VERISON ${NODE_VERSION}
RUN apt-get update && \
# Installs the node repository
apt-get install -y ca-certificates curl gnupg && \
mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
NODE_MAJOR=16 && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt-get update && \
apt-get install nodejs -y && \
# Installs libvips and the node repository
apt-get install --yes libvips42 nodejs && \
apt-get install npm -y
RUN npm install --global yarn && \
apt-get autoremove -y
ARG BUNDLER_VERSION=2.3.11
ENV BUNDLER_VERSION=${BUNDLER_VERSION}
RUN gem install bundler -v $BUNDLER_VERSION --no-document
# Install Google Chrome
# Set up the Chrome PPA
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
# Update the package list and install chrome
RUN apt-get update -y
RUN apt-get install -y google-chrome-stable
# Install chromedriver
RUN CHROMEDRIVER_VERSION=$(curl https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE); \
wget https://storage.googleapis.com/chrome-for-testing-public/$CHROMEDRIVER_VERSION/linux64/chromedriver-linux64.zip
RUN unzip chromedriver-linux64.zip
RUN rm -f chromedriver-linux64.zip
RUN mv chromedriver-linux64/chromedriver /usr/bin/chromedriver
RUN chown root:root /usr/bin/chromedriver
RUN chmod +x /usr/bin/chromedriver