Skip to content

Commit

Permalink
Merge pull request #9 from juntossomosmais/fix/stable-chrome
Browse files Browse the repository at this point in the history
feat: corrige install chrome
  • Loading branch information
lizarbventurim authored Oct 23, 2024
2 parents 56fa1c1 + 51b638e commit 193de33
Showing 1 changed file with 8 additions and 24 deletions.
32 changes: 8 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,13 @@ RUN npm --version
RUN java -version

# Install essential packages and dependencies
RUN apt-get update && \
apt-get install -y \
openjdk-11-jdk \
maven \
wget \
unzip \
xvfb \
libxi6 \
libgconf-2-4 \
gnupg \
curl \
&& rm -rf /var/lib/apt/lists/*

# Fetch the latest stable Chrome version and install Chrome and ChromeDriver
RUN CHROME_VERSION=$(curl -sSL https://googlechromelabs.github.io/chrome-for-testing/ | awk -F 'Version:' '/Stable/ {print $2}' | awk '{print $1}' | sed 's/<code>//g; s/<\/code>//g') && \
CHROME_URL="https://storage.googleapis.com/chrome-for-testing-public/${CHROME_VERSION}/linux64/chrome-linux64.zip" && \
echo "Fetching Chrome version: ${CHROME_VERSION}" && \
curl -sSL ${CHROME_URL} -o /tmp/chrome-linux64.zip && \
mkdir -p /opt/google/chrome && \
mkdir -p /usr/local/bin && \
unzip -q /tmp/chrome-linux64.zip -d /opt/google/chrome && \
rm /tmp/chrome-linux64.zip
RUN apt-get update && apt-get install -y ca-certificates wget gnupg2
RUN apt-get install -y --no-install-recommends graphicsmagick && rm -rf /var/lib/apt/lists/*
# Chrome
RUN echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN set -x && apt-get update && apt-get install -y google-chrome-stable
ENV CHROME_BIN /usr/bin/google-chrome

Check warning on line 25 in Dockerfile

View workflow job for this annotation

GitHub Actions / build

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

# Instalar dependências do Cypress

Expand All @@ -57,5 +42,4 @@ WORKDIR /usr/src/app
EXPOSE 8080

# Script para personalizar comandos
ENTRYPOINT ["./entrypoint.sh", "npx", "cypress", "run"]

ENTRYPOINT ["./entrypoint.sh", "npx", "cypress", "run"]

0 comments on commit 193de33

Please sign in to comment.