Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
BorisKofman committed Dec 15, 2023
1 parent 6ed6e13 commit 76503de
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 34 deletions.
37 changes: 29 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,32 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build the hello-docker Docker image
run: |
docker pull cypress/browsers:node-16.18.1-chrome-110.0.5481.96-1-ff-109.0-edge-110.0.1587.41-1
docker tag cypress/browsers:node-16.18.1-chrome-110.0.5481.96-1-ff-109.0-edge-110.0.1587.41-1 ghcr.io/boriskofman/browsers:node-16.18.1-chrome-110.0.5481.96-1-ff-109.0-edge-110.0.1587.41-1
docker push ghcr.io/boriskofman/browsers:node-16.18.1-chrome-110.0.5481.96-1-ff-109.0-edge-110.0.1587.41-1
docker pull cypress/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1
docker tag cypress/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1 ghcr.io/boriskofman/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1
docker push ghcr.io/boriskofman/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1
# - name: Build the hello-docker Docker image
# run: |
# docker pull cypress/browsers:node-16.18.1-chrome-110.0.5481.96-1-ff-109.0-edge-110.0.1587.41-1
# docker tag cypress/browsers:node-16.18.1-chrome-110.0.5481.96-1-ff-109.0-edge-110.0.1587.41-1 ghcr.io/boriskofman/browsers:node-16.18.1-chrome-110.0.5481.96-1-ff-109.0-edge-110.0.1587.41-1
# docker push ghcr.io/boriskofman/browsers:node-16.18.1-chrome-110.0.5481.96-1-ff-109.0-edge-110.0.1587.41-1
# # docker pull cypress/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1
# # docker tag cypress/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1 ghcr.io/boriskofman/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1
# # docker push ghcr.io/boriskofman/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# -
# name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
push: true
platforms: |
linux/amd64
file: images/Dockerfile
tags: ghcr.io/boriskofman/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1
100 changes: 74 additions & 26 deletions images/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,84 @@
FROM cypress/browsers:node-16.18.1-chrome-110.0.5481.96-1-ff-109.0-edge-110.0.1587.41-1
# Use Ubuntu 22.04 (Jammy) as the base image
FROM ubuntu:jammy

# Set Node.js version as a build argument
ARG NODE=20

#ENV
# Avoid any prompts
ENV DEBIAN_FRONTEND noninteractive
# a few environment variables to make NPM installs easier
# good colors for most applications
ENV TERM=xterm
# avoid million NPM install messages
ENV npm_config_loglevel=warn
# allow installing when the main user is root
ENV npm_config_unsafe_perm=true
# "fake" dbus address to prevent errors
# https://github.com/SeleniumHQ/docker-selenium/issues/87
ENV DBUS_SESSION_BUS_ADDRESS=/dev/null

USER root
# Set environment variables for better npm experience
ENV TERM xterm
ENV npm_config_loglevel warn
ENV npm_config_unsafe_perm true

# Update the package manager and install necessary tools
RUN apt-get update && \
apt-get install -y apt-transport-https ca-certificates curl gnupg build-essential git unzip wget

# Add Node.js repository and install Node.js
RUN mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt-get update && \
apt-get install -y nodejs

RUN apt update -y && \
apt install -y \
unzip \
cmake \
build-essential \
tzdata \
# Install the latest NPM and Yarn
RUN npm install -g npm@latest && \
npm install -g yarn@latest

# Install additional dependencies
RUN apt-get install -y \
libatk1.0-0 \
libgtk2.0-0 \
libglib2.0-0 \
libatk-bridge2.0-0 \
libcups2 \
libgtk-3-0 \
libgbm1 \
libnotify-dev \
libgconf-2-4 \
libnss3 \
libxss1 \
libasound2 \
xvfb \
dbus
dbus \
cmake

# Install Google Chrome browser
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list && \
apt-get update && \
apt-get install -y dbus-x11 google-chrome-stable && \
rm -rf /var/lib/apt/lists/*

# Set "fake" DBUS address to prevent errors
ENV DBUS_SESSION_BUS_ADDRESS=/dev/null

# Generate and print machine-id for DBUS
RUN dbus-uuidgen > /var/lib/dbus/machine-id
# dbus-daemon --config-file=/usr/share/dbus-1/system.conf --print-address

# Create a user named "runner"
RUN mkdir -p /run/dbus

# Start the DBUS service
RUN service dbus start

#DBUS
RUN dbus-uuidgen > /var/lib/dbus/machine-id
# Set the working directory
WORKDIR /home/runner

RUN service dbus start
# Display version information
RUN echo "Node version: $(node -v)" && \
echo "NPM version: $(npm -v)" && \
echo "Yarn version: $(yarn -v)" && \
echo "Debian version: $(cat /etc/debian_version)" && \
echo "User: $(whoami)" && \
echo "Git version: $(git --version)"

RUN npm install -g node-gyp
RUN npm install -g cpu-features
# Display additional version information
RUN cat /etc/lsb-release && \
cat /etc/os-release

RUN rm -rf ~/.node_modules
# Install CPU-features globally
RUN npm install -g cpu-features

0 comments on commit 76503de

Please sign in to comment.