Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add cypress images for docker #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions images/cypres9.4.1-amd64/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
FROM node:16.13.0-bullseye as builder

ARG VERSION=9.4.1
ENV CY_VERSION=$VERSION

# Install build dependencies
RUN apt-get update && \
apt-get install --no-install-recommends -y \
libgtk2.0-0 \
libgtk-3-0 \
libnotify-dev \
libgconf-2-4 \
libgbm-dev \
libnss3 \
libxss1 \
libasound2 \
libxtst6 \
xauth \
xvfb \
# clean up
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

# build cypress binary
RUN git clone https://github.com/cypress-io/cypress.git --depth 1 --branch v${CY_VERSION} \
&& cd /cypress \
&& yarn --loglevel verbose \
&& yarn binary-build --version ${CY_VERSION} myvalue=3

FROM cypress/browsers:node16.14.2-slim-chrome100-ff99-edge

ARG VERSION=9.4.1

ENV TERM=xterm \
NPM_CONFIG_LOGLEVEL=warn \
QT_X11_NO_MITSHM=1 \
_X11_NO_MITSHM=1 \
_MITSHM=0 \
CYPRESS_INSTALL_BINARY=0 \
CYPRESS_CACHE_FOLDER=/root/.cache/Cypress \
CY_VERSION=$VERSION

RUN apt-get update && \
apt-get install --no-install-recommends -y \
libgtk2.0-0 \
libgtk-3-0 \
libnotify-dev \
libgconf-2-4 \
libgbm-dev \
libnss3 \
libxss1 \
libasound2 \
libxtst6 \
xauth \
xvfb \
# clean up
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean \
# https://github.com/cypress-io/cypress/issues/4351#issuecomment-559489091
echo 'pcm.!default {\n type hw\n card 0\n}\n\nctl.!default {\n type hw\n card 0\n}' > /root/.asoundrc

# Copy cypress binary from intermediate container
COPY --from=builder /tmp/cypress-build/linux/build/linux-unpacked /root/.cache/Cypress/${CY_VERSION}/Cypress

RUN npm install -g cypress@${CY_VERSION} && \
cypress verify

# install required packages and utilities
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
apt-utils \
locales \
curl \
unzip

# install chromium
RUN apt-get update && apt-get install -y --no-install-recommends \
chromium

ENTRYPOINT ["cypress", "run"]

12 changes: 12 additions & 0 deletions images/cypres9.4.1-amd64/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## cypress/amd64:9.4.1

Образ с Cypress версии 9.4.1.

Содержит версии:
- node: 16.13.0
- chromium: latest

Как собрать
```bash
docker build -t "cypress/amd64:9.4.1" --build-arg VERSION=9.4.1 .
```
81 changes: 81 additions & 0 deletions images/cypres9.4.1-arm64/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# By defualt docker build via arm64 because it starting on m1
FROM node:16.13.0-bullseye as builder

ARG VERSION=9.4.1
ENV CY_VERSION=$VERSION

# Install build dependencies
RUN apt-get update && \
apt-get install --no-install-recommends -y \
libgtk2.0-0 \
libgtk-3-0 \
libnotify-dev \
libgconf-2-4 \
libgbm-dev \
libnss3 \
libxss1 \
libasound2 \
libxtst6 \
xauth \
xvfb \
# clean up
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

# build cypress binary
RUN git clone https://github.com/cypress-io/cypress.git --depth 1 --branch v${CY_VERSION} \
&& cd /cypress \
&& yarn \
&& yarn binary-build --version ${CY_VERSION} myvalue=3

FROM cypress/browsers:node16.14.2-slim-chrome100-ff99-edge

ARG VERSION=9.4.1

ENV TERM=xterm \
NPM_CONFIG_LOGLEVEL=warn \
QT_X11_NO_MITSHM=1 \
_X11_NO_MITSHM=1 \
_MITSHM=0 \
CYPRESS_INSTALL_BINARY=0 \
CYPRESS_CACHE_FOLDER=/root/.cache/Cypress \
CY_VERSION=$VERSION

RUN apt-get update && \
apt-get install --no-install-recommends -y \
libgtk2.0-0 \
libgtk-3-0 \
libnotify-dev \
libgconf-2-4 \
libgbm-dev \
libnss3 \
libxss1 \
libasound2 \
libxtst6 \
xauth \
xvfb \
# clean up
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean \
# https://github.com/cypress-io/cypress/issues/4351#issuecomment-559489091
echo 'pcm.!default {\n type hw\n card 0\n}\n\nctl.!default {\n type hw\n card 0\n}' > /root/.asoundrc

# Copy cypress binary from intermediate container
COPY --from=builder /tmp/cypress-build/linux/build/linux-arm64-unpacked /root/.cache/Cypress/${CY_VERSION}/Cypress

RUN npm install -g cypress@${CY_VERSION} && \
cypress verify

# install required packages and utilities
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
apt-utils \
locales \
curl \
unzip

# install chromium
RUN apt-get update && apt-get install -y --no-install-recommends \
chromium

ENTRYPOINT ["cypress", "run"]
12 changes: 12 additions & 0 deletions images/cypres9.4.1-arm64/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## cypress/arm64:9.4.1

Образ с Cypress версии 9.4.1, которая поддерживает arm64 архитектуру.

Содержит версии:
- node: 16.13.0
- chromium: latest

Как собрать
```bash
docker build -t "cypress/arm64:9.4.1" --build-arg VERSION=9.4.1 .
```