Skip to content

Commit f861f96

Browse files
authored
DevOps: Fix docker-test by locking to amd64 and updating dependencies (#955)
* Update of dependencies and fix chrome and firefox installs * Drop to jammy LTS and remove $HOME variable
1 parent 1da08a6 commit f861f96

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ harness:
1818
harness-down:
1919
./test-harness.sh down
2020

21+
# Force to platform=linux/amd64 because chrome isn't available on arm64
2122
docker-build:
22-
docker build -t js-sdk-testing -f tests/cucumber/docker/Dockerfile $(CURDIR) --build-arg TEST_BROWSER --build-arg CI=true
23+
docker build --platform=linux/amd64 -t js-sdk-testing -f tests/cucumber/docker/Dockerfile $(CURDIR) --build-arg TEST_BROWSER --build-arg CI=true
2324

2425
docker-run:
2526
docker ps -a
26-
docker run -it --network host js-sdk-testing:latest
27+
docker run --platform=linux/amd64 -it --network host js-sdk-testing:latest
2728

2829
smoke-test-examples:
2930
cd examples && bash smoke_test.sh && cd -

tests/cucumber/docker/Dockerfile

+14-12
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1-
FROM ubuntu:focal
1+
FROM ubuntu:jammy
22

33
# install wget, gnupg2, make
4-
RUN apt-get update -qqy \
5-
&& apt-get -qqy install wget gnupg2 make
4+
RUN apt-get -qqy update \
5+
&& DEBIAN_FRONTEND=noninteractive apt-get -qqy install wget gnupg2 make
66

77
# install chrome, firefox
88
# based on https://github.com/SeleniumHQ/docker-selenium/blob/trunk/NodeChrome/Dockerfile
9-
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
10-
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
11-
&& apt-get update -qqy \
12-
&& apt-get -qqy --no-install-recommends install google-chrome-stable firefox
9+
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor | tee /etc/apt/trusted.gpg.d/google.gpg >/dev/null && \
10+
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list && \
11+
wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null && \
12+
echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null && \
13+
DEBIAN_FRONTEND=noninteractive apt-get -qqy update && \
14+
DEBIAN_FRONTEND=noninteractive apt-get -qqy install firefox google-chrome-stable
1315

1416
# install node
15-
RUN wget -q -O - https://deb.nodesource.com/setup_18.x | bash \
16-
&& apt-get -qqy --no-install-recommends install nodejs \
17+
RUN wget -q -O - https://deb.nodesource.com/setup_22.x | bash \
18+
&& DEBIAN_FRONTEND=noninteractive apt-get -qqy --no-install-recommends install nodejs \
1719
&& echo "node version: $(node --version)" \
1820
&& echo "npm version: $(npm --version)"
1921

2022
# Copy SDK code into the container
21-
RUN mkdir -p $HOME/js-algorand-sdk
22-
COPY . $HOME/js-algorand-sdk
23-
WORKDIR $HOME/js-algorand-sdk
23+
RUN mkdir -p /app/js-algorand-sdk
24+
COPY . /app/js-algorand-sdk
25+
WORKDIR /app/js-algorand-sdk
2426

2527
ARG TEST_BROWSER
2628
ENV TEST_BROWSER=$TEST_BROWSER

0 commit comments

Comments
 (0)