Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
8176233
build(actions): add CI actions
shevchenkov-neuralegion Mar 31, 2022
93cf5d7
build(actions): add CI actions
Apr 4, 2022
627c00a
build(actions): fix tags
shevchenkov-neuralegion Apr 4, 2022
0d6f6e5
build(actions): fix tags
Apr 4, 2022
cd9e629
♻️ [email protected]
web-flow Apr 4, 2022
5fcbfa0
fix: change window size (#3)
shevchenkov-neuralegion Apr 12, 2022
567045b
perf: increase default network params (#4)
gasRU76 Apr 15, 2022
f9b896b
♻️ [email protected]
web-flow Apr 26, 2022
ed815b1
♻️ [email protected]
web-flow May 17, 2022
b34d0be
feat: add curl
Jul 7, 2022
ef57d4e
Merge pull request #5 from NeuraLegion/feat/add_curl
RomanAyupov89 Jul 7, 2022
211c445
fix: ecs
gasRU76 Jul 13, 2022
6da52c6
Merge pull request #6 from NeuraLegion/ecs_fix
gasRU76 Jul 13, 2022
477f2f1
also push image to aws (#7)
Jul 13, 2022
62fa464
add tag to image
Jul 13, 2022
2bfd72d
fix AWS authentication
Jul 13, 2022
26d3227
fix AWS authentication
Jul 13, 2022
2899fac
♻️ [email protected]
web-flow Jul 29, 2022
20f65ad
feat: build headful chrome image (#9)
Aug 5, 2022
b6af1b4
fix: build
Aug 5, 2022
9967105
fix: build
Aug 5, 2022
75dca49
fix: headful deployment to AWS (#10)
Aug 5, 2022
b0b230b
Revert "fix: headful deployment to AWS (#10)" (#11)
Aug 5, 2022
1f937f8
fix: checking update for headful chrome
Aug 8, 2022
09388d3
♻️ [email protected]
web-flow Aug 31, 2022
73c4ac6
♻️ [email protected]
web-flow Aug 31, 2022
7d3f3df
♻️ [email protected]
web-flow Sep 21, 2022
76677f9
♻️ [email protected]
web-flow Sep 21, 2022
f41cabc
feat(headless): use headless mode chrome (#12)
dammer Oct 7, 2022
e483e3c
fix: only spp (#14)
dammer Oct 7, 2022
e29917a
feat(image): add chrome build
shevchenkov-neuralegion Oct 7, 2022
fdd4fc0
Merge pull request #13 from NeuraLegion/feat/chrome
shevchenkov-neuralegion Oct 10, 2022
3379a10
fix: disable print option (#15)
shevchenkov-neuralegion Oct 11, 2022
dbc5c48
fix(chrome): use headless=true instead 'chrome' (#16)
shevchenkov-neuralegion Oct 12, 2022
849c02d
fix(chrome): add backslash to entrypoint.sh
shevchenkov-neuralegion Oct 12, 2022
fa6c420
fix: processing sigterm signal (#19)
gasRU76 Oct 24, 2022
dc67556
fix: run chrome in headless=chrome mode (#17)
alexkutsan Oct 26, 2022
e4b6449
♻️ [email protected]
web-flow Nov 16, 2022
3ae91ff
♻️ [email protected]
web-flow Nov 16, 2022
54a6e56
♻️ [email protected]
web-flow Dec 7, 2022
cf7adf3
♻️ [email protected]
web-flow Dec 7, 2022
2a21bba
♻️ [email protected]
web-flow Jan 25, 2023
0fdcfbd
♻️ [email protected]
web-flow Jan 25, 2023
3021741
♻️ [email protected]
web-flow Feb 22, 2023
7b083f9
♻️ [email protected]
web-flow Feb 22, 2023
1ede6db
♻️ [email protected]
web-flow Mar 15, 2023
0c4c789
♻️ [email protected]
web-flow Mar 15, 2023
bf46d05
♻️ [email protected]
web-flow Apr 19, 2023
3bd5b7b
fix(oopif): add 'site-per-process' flag (#20)
shevchenkov-neuralegion Jun 8, 2023
eb215cd
fix(chrome): properties list
shevchenkov-neuralegion Jun 8, 2023
dd9912b
revert(chrome): fix properties list
shevchenkov-neuralegion Jun 8, 2023
b1e8d89
fix(chrome): pin chrome version for nextools-chrome image
shevchenkov-neuralegion Jun 8, 2023
eb3e3ea
fix(chrome): add usage of version arg in dockerfile
shevchenkov-neuralegion Jun 8, 2023
5a14033
fix(chrome): add usage of version arg
shevchenkov-neuralegion Jun 8, 2023
b81c095
fix(chrome): downgrade version to 108.0.5359.124-1
shevchenkov-neuralegion Jun 8, 2023
0139ff9
Revert "fix(chrome): downgrade version to 108.0.5359.124-1"
dammer Jan 9, 2024
9599791
update to latest stable
dammer Jan 9, 2024
49bafe0
Merge pull request #21 from NeuraLegion/fix/TM-879-upgrade
dammer Jan 9, 2024
7b799b5
ci test
dammer Jan 9, 2024
f030591
fix: aws
dammer Jan 9, 2024
776a608
Update configure-aws-credentials to v4
Jan 9, 2024
c8f6b6e
Revert "ci test"
dammer Jan 10, 2024
632c930
disable no sandbox
dammer Jan 10, 2024
e1ffc9f
try omesa fix
dammer Jan 10, 2024
3f7ff05
try omesa fix 2
dammer Jan 10, 2024
a72fca4
Revert "try omesa fix 2"
dammer Jan 10, 2024
30f5048
Revert "try omesa fix"
dammer Jan 10, 2024
364f299
Revert "disable no sandbox"
dammer Jan 10, 2024
0c7c332
Revert "update to latest stable"
dammer Jan 11, 2024
023c08f
Revert "Revert "fix(chrome): downgrade version to 108.0.5359.124-1""
dammer Jan 11, 2024
6a382bd
Revert "Revert "Revert "fix(chrome): downgrade version to 108.0.5359.…
dammer Jan 23, 2024
4b95364
Revert "Revert "update to latest stable""
dammer Jan 23, 2024
4fb8052
update to 120.0.6099.224 with Artem config
dammer Jan 23, 2024
c803a9a
flags revisioned
dammer Jan 24, 2024
1a519ed
fix: port
dammer Jan 24, 2024
72550a2
fix: changes with select version 121.0.6167.85-1
dammer Jan 24, 2024
4a3a0fc
update chrome 121.0.6167.184-1
dammer Feb 19, 2024
130790a
--headless=old 122.0.6261.57-1
dammer Feb 22, 2024
d899f27
fix: remove socat
dammer Feb 22, 2024
8d4e66b
return socat on localhost
dammer Feb 22, 2024
6c46307
update chrome to 122.0.6261.111-1
dammer Mar 12, 2024
ebe17a6
feat: switch to chrome 127 (#22)
anton7c3 Aug 21, 2024
5bf32e5
feat(ci): add manual run to Docker Image CI workflow (#23)
anton7c3 Aug 21, 2024
c7f79ef
ci: migrate to AWS oidc authorization
gasRU76 Jan 28, 2025
b3b9ffd
fix
gasRU76 Jan 28, 2025
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
55 changes: 55 additions & 0 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Docker Image CI

on:
schedule:
- cron: 0 0 * * 6
push:
branches:
- master
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
container: neuralegion/devops

strategy:
matrix:
package:
- chromium
- chromium-headful
- chrome

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ vars.AWS_DEFAULT_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Get version
id: get_version
run: echo ::set-output name=result::$(make --file ${{ matrix.package }}/Makefile get-version)

- name: Build image
run: make --file ${{ matrix.package }}/Makefile build version=${{ steps.get_version.outputs.result }}

- name: Login into Docker
run: docker login --username=anatol1988 --password=${{ secrets.DOCKER_TOKEN }}

- name: Push image to Docker
run: docker push neuralegion/nextools-${{ matrix.package }}

- name: Push Docker image to AWS ECR
run: docker push 454884832027.dkr.ecr.us-east-1.amazonaws.com/nextools-${{ matrix.package }}

24 changes: 8 additions & 16 deletions .github/workflows/on-schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
repository_dispatch:
types: check
schedule:
# every 12 hours
- cron: '0 */12 * * *'
# every 3 days
- cron: 0 0 * * 3

jobs:
check:
Expand All @@ -15,7 +15,7 @@ jobs:
matrix:
package:
- chromium
- firefox
- chromium-headful

steps:
- name: Checkout
Expand All @@ -31,7 +31,7 @@ jobs:

- name: Check status
id: check_status
run: echo ::set-output name=result::$(git tag | grep --quiet ${{ matrix.package }}@${{ steps.get_version.outputs.result }} && echo 'up-to-date' || echo 'outdated')
run: echo ::set-output name=result::$(git tag | grep --quiet chromium@${{ steps.get_version.outputs.result }} && echo 'up-to-date' || echo 'outdated')

- name: Print results
run: |
Expand Down Expand Up @@ -84,18 +84,10 @@ jobs:
if: steps.check_status.outputs.result == 'outdated'
run: git push --force --tags origin master

- name: Docker GitHub Packages login
- name: Login into Docker
if: steps.check_status.outputs.result == 'outdated'
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login --username ${{ github.actor }} --password-stdin docker.pkg.github.com
run: docker login --username=anatol1988 --password=${{ secrets.DOCKER_TOKEN }}

- name: Docker GitHub Packages push
- name: Push image to Docker
if: steps.check_status.outputs.result == 'outdated'
run: docker push docker.pkg.github.com/nextools/images/${{ matrix.package }}

- name: Docker Hub login
if: steps.check_status.outputs.result == 'outdated'
run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login --username nextoolsbot --password-stdin

- name: Docker Hub push
if: steps.check_status.outputs.result == 'outdated'
run: docker push nextools/${{ matrix.package }}
run: docker push neuralegion/nextools-${{ matrix.package }}
29 changes: 29 additions & 0 deletions chrome/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM ubuntu:bionic

ARG VERSION
ARG DEBIAN_FRONTEND=noninteractive
ENV DBUS_SESSION_BUS_ADDRESS disabled:
ENV RD_PORT=9222

RUN apt-get update \
# https://github.com/phusion/baseimage-docker/issues/319
&& apt-get install --yes apt-utils 2>&1 | grep -v "debconf: delaying package configuration, since apt-utils is not installed" \
&& apt-get install -y wget gnupg \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/googlechrome-linux-keyring.gpg \
&& sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/googlechrome-linux-keyring.gpg] https://dl-ssl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& wget --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${VERSION}_amd64.deb \
&& apt-get update \
&& apt-get install -y /tmp/chrome.deb fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-khmeros fonts-kacst fonts-freefont-ttf libxss1 dumb-init socat dbus dbus-x11 \
--no-install-recommends \
&& service dbus start \
&& rm -rf /var/lib/apt/lists/* \
&& groupadd -r chrome && useradd --create-home -rm -g chrome -G audio,video chrome


WORKDIR /home/chrome

COPY --chown=chrome:chrome entrypoint.sh /home/chrome/

USER chrome

ENTRYPOINT ["dumb-init", "--", "/bin/sh", "/home/chrome/entrypoint.sh"]
32 changes: 32 additions & 0 deletions chrome/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.PHONY: get-version build test tags

CURRENT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
VERSION:="127.0.6533.88-1"

# get-version:
# @docker pull ubuntu:bionic > /dev/null 2>&1
# @docker run --rm \
# ubuntu:bionic \
# sh -c "apt-get update --quiet=2 && apt-cache policy chromium-browser | sed --regexp-extended --quiet 's/.*Candidate: ([0-9.]+)-.+/\1/p'"

get-version:
@echo $(VERSION)

build:
@docker build --tag neuralegion/nextools-chrome --tag 454884832027.dkr.ecr.us-east-1.amazonaws.com/nextools-chrome --build-arg VERSION=$(VERSION) $(CURRENT_DIR)

test:
@docker run --detach --publish 9222:9222 --name nextools-chrome neuralegion/nextools-chrome
@timeout 20s sh -c "trap 'docker container rm --force nextools-chrome' 0; until curl http://localhost:9222/json/version; do sleep 1; done"

tags:
@for i in 3 2 1 0 -1; do \
if [ $$i -ge 0 ]; then \
tag=`echo $(version) | sed --regexp-extended "s/(\.[0-9]+){$$i}$$//"`; \
else \
tag=latest; \
fi; \
echo $$tag; \
docker tag nextools-chrome neuralegion/nextools-chrome:$$tag; \
git tag --force nextools-chrome@$$tag; \
done
68 changes: 68 additions & 0 deletions chrome/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/sh

if [ "$(ls -A /home/chrome/.fonts/)" ]; then
fc-cache -f -v
fi

RD_PORT="${RD_PORT:=9222}"

ip=$(hostname --ip-address)
socat tcp-listen:$RD_PORT,bind="$ip",fork tcp:127.0.0.1:$RD_PORT &

(ulimit -n 65000 || true) && (ulimit -p 65000 || true) && exec google-chrome-stable \
--enable-automation \
--silent-debugger-extension-api \
--allow-pre-commit-input \
--ash-no-nudges \
--disable-gpu-process-crash-limit \
--disable-background-networking \
--disable-background-timer-throttling \
--disable-backgrounding-occluded-windows \
--disable-renderer-backgrounding \
--disable-breakpad \
--disable-client-side-phishing-detection \
--disable-setuid-sandbox \
--disable-default-apps \
--disable-speech-api \
--disable-dev-shm-usage \
--disable-domain-reliability \
--disable-notifications \
--disable-extensions \
--disable-field-trial-config \
--disable-popup-blocking \
--disable-prompt-on-repost \
--disable-search-engine-choice-screen \
--disable-offer-store-unmasked-wallet-cards \
--disable-sync \
--disable-component-extensions-with-background-pages \
--deny-permission-prompts \
--disable-print-preview \
--noerrdialogs \
--disable-hang-monitor \
--disable-ipc-flooding-protection \
--disable-component-update \
--headless=old \
--export-tagged-pdf \
--force-color-profile=srgb \
--no-zygote \
--start-maximized \
--password-store=basic \
--use-mock-keychain \
--disable-features=Translate,AcceptCHFrame,MediaRouter,OptimizationHints,ProcessPerSiteUpToMainFrameThreshold,ImprovedCookieControls \
--enable-features=NetworkServiceInProcess2 \
--hide-scrollbars \
--ignore-certificate-errors \
--ignore-certificate-errors-spki-list \
--ignore-ssl-errors \
--ignore-unknown-auth-factors \
--metrics-recording-only \
--mute-audio \
--no-first-run \
--no-sandbox \
--no-default-browser-check \
--remote-debugging-address=127.0.0.1 \
--remote-debugging-port="$RD_PORT" \
--user-data-dir=/home/chrome/ \
--window-size=1920,1080 \
--window-position=0,0 \
"$@"
22 changes: 22 additions & 0 deletions chrome/license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# The MIT License (MIT)

* Copyright (c) 2018–2020 Kir Belevich
* Copyright (c) 2020–present NexTools

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
36 changes: 36 additions & 0 deletions chrome/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# chrome

Dockerized Chrome

## Usage

### Docker Hub

```sh
docker run -it --rm -p 9222:9222 neuralegion/nextools-chrome:<TAG>
```
-->

## How to

### specify a different port

Container uses a `RD_PORT` [environment variable](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file), which is `9222` by default:

```
docker run -it --rm -p 9223:9223 -e RD_PORT=9223 neuralegion/nextools-chrome:<TAG>
```

### pass additional Chrome arguments

```
docker run -it --rm -p 9222:9222 neuralegion/nextools-chrome:<TAG> --some-chrome-arg
```

### add custom fonts

It's possible to mount a folder with custom fonts to be used later by Chrome:

```
docker run -it --rm -p 9222:9222 -v $(pwd)/path/to/fonts:/home/chrome/.fonts neuralegion/nextools-chrome:<TAG>
```
31 changes: 31 additions & 0 deletions chromium-headful/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM ubuntu:bionic

ARG VERSION
ARG DEBIAN_FRONTEND=noninteractive
ENV RD_PORT=9222

RUN apt-get update \
# https://github.com/phusion/baseimage-docker/issues/319
&& apt-get install --yes apt-utils 2>&1 | grep -v "debconf: delaying package configuration, since apt-utils is not installed" \
&& apt-get install --no-install-recommends --yes \
htop \
net-tools \
dumb-init \
fontconfig \
chromium-browser=${VERSION}\* \
curl \
xvfb \
socat \
&& rm -rf /var/lib/apt/lists/*

RUN groupadd chromium
RUN useradd --create-home --gid chromium chromium
RUN chown --recursive chromium:chromium /home/chromium/

VOLUME ["/home/chromium/.fonts"]

COPY --chown=chromium:chromium entrypoint.sh /home/chromium/

USER chromium

ENTRYPOINT ["dumb-init", "--", "/bin/sh", "/home/chromium/entrypoint.sh"]
28 changes: 28 additions & 0 deletions chromium-headful/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.PHONY: get-version build test tags

CURRENT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))

get-version:
@docker pull ubuntu:bionic > /dev/null 2>&1
@docker run --rm \
ubuntu:bionic \
sh -c "apt-get update --quiet=2 && apt-cache policy chromium-browser | sed --regexp-extended --quiet 's/.*Candidate: ([0-9.]+)-.+/\1/p'"

build:
@docker build --tag neuralegion/nextools-chromium-headful --tag 454884832027.dkr.ecr.us-east-1.amazonaws.com/nextools-chromium-headful --build-arg VERSION=$(version) $(CURRENT_DIR)

test:
@docker run --detach --publish 9222:9222 --name nextools-chromium-headful neuralegion/nextools-chromium-headful
@timeout 20s sh -c "trap 'docker container rm --force nextools-chromium' 0; until curl http://localhost:9222/json/version; do sleep 1; done"

tags:
@for i in 3 2 1 0 -1; do \
if [ $$i -ge 0 ]; then \
tag=`echo $(version) | sed --regexp-extended "s/(\.[0-9]+){$$i}$$//"`; \
else \
tag=latest; \
fi; \
echo $$tag; \
docker tag nextools-chromium-headful neuralegion/nextools-chromium-headful:$$tag; \
git tag --force nextools-chromium-headful@$$tag; \
done
Loading