Skip to content

Commit bcf6768

Browse files
authored
Docker: Use curl static binary (#2725)
* Docker: Use curl static binary * Update sample Dockerfile * Update build FFmpeg --------- Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent f0ab6c9 commit bcf6768

9 files changed

+24
-40
lines changed

.ffmpeg/Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
FROM ubuntu:noble AS builder
2-
ARG FFMPEG_VERSION="7.1"
2+
ARG FFMPEG_VERSION="7.1.1"
33
ARG RCLONE_VER="v1.69.1"
44
ARG GO_VERSION="latest"
55
ARG GO_CRYPTO_VERSION="v0.35.0"
66
ARG GO_OAUTH2_VERSION="v0.27.0"
7+
ARG GO_NET_VERSION="v0.36.0"
78

89
USER root
910

@@ -30,12 +31,13 @@ RUN if [ "${GO_VERSION}" = "latest" ]; then \
3031
&& go version
3132

3233
RUN cd /usr/local/src \
33-
&& git clone https://github.com/rclone/rclone.git \
34+
&& git clone https://github.com/rclone/rclone.git --filter=blob:none \
3435
&& cd rclone \
3536
&& git checkout ${RCLONE_VER} \
3637
# Patch deps version in go.mod to fix CVEs
3738
&& sed -i "s|golang.org/x/crypto v.*|golang.org/x/crypto ${GO_CRYPTO_VERSION}|g" go.mod \
3839
&& sed -i "s|golang.org/x/oauth2 v.*|golang.org/x/oauth2 ${GO_OAUTH2_VERSION}|g" go.mod \
40+
&& sed -i "s|golang.org/x/net v.*|golang.org/x/net ${GO_NET_VERSION}|g" go.mod \
3941
&& go mod tidy \
4042
# Build rclone
4143
&& make \
@@ -46,7 +48,7 @@ RUN cd /usr/local/src \
4648
# Install x264 from source
4749
#======================================
4850
RUN cd /usr/local/src \
49-
&& git clone https://code.videolan.org/videolan/x264.git \
51+
&& git clone https://code.videolan.org/videolan/x264.git --filter=blob:none \
5052
&& cd x264 \
5153
&& ./configure --prefix="/usr/local" --enable-static \
5254
&& make \
@@ -56,9 +58,9 @@ RUN cd /usr/local/src \
5658
# Install FFmpeg from source
5759
#======================================
5860
RUN cd /usr/local/src \
59-
&& git clone https://github.com/FFmpeg/FFmpeg.git \
61+
&& git clone https://github.com/FFmpeg/FFmpeg.git --filter=blob:none \
6062
&& cd FFmpeg \
61-
&& git checkout release/${FFMPEG_VERSION} \
63+
&& git checkout n${FFMPEG_VERSION} \
6264
&& rm -rf .git \
6365
&& PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" FFMPEG_VERSION=${FFMPEG_VERSION} ./configure \
6466
--prefix="/usr/local" \

.github/workflows/docker-test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,16 @@ jobs:
172172
- name: Format and lint scripts
173173
run: |
174174
make format_shell_scripts
175+
- name: Disable QEMU
176+
if: matrix.test-strategy == 'test_node_relay' && contains(matrix.os, 'amd') == true
177+
run: echo "DOCKER_ENABLE_QEMU=false >> $GITHUB_ENV"
175178
- name: Set up containerd image store feature
176179
uses: nick-invision/retry@master
177180
with:
178181
timeout_minutes: 10
179182
max_attempts: 3
180183
command: |
181-
make setup_dev_env
184+
DOCKER_ENABLE_QEMU=${DOCKER_ENABLE_QEMU} make setup_dev_env
182185
- name: Output Docker info
183186
run: docker info
184187
- name: Set up Python

Base/Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ ENV DEBIAN_FRONTEND=noninteractive \
4545
# Miscellaneous packages
4646
# Includes minimal runtime used for executing non GUI Java programs
4747
#========================
48+
RUN echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu noble main restricted universe multiverse\n" > /etc/apt/sources.list \
49+
&& echo "deb-src [arch=amd64] http://archive.ubuntu.com/ubuntu noble main restricted universe multiverse\n" >> /etc/apt/sources.list \
50+
&& echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble main restricted universe multiverse" >> /etc/apt/sources.list \
51+
&& echo "deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble main restricted universe multiverse" >> /etc/apt/sources.list
52+
4853
RUN apt-get -qqy update \
4954
&& apt-get upgrade -yq \
5055
&& apt-get -qqy --no-install-recommends install \
@@ -56,14 +61,18 @@ RUN apt-get -qqy update \
5661
unzip \
5762
wget \
5863
jq \
59-
curl \
6064
supervisor \
6165
gnupg2 \
6266
libnss3-tools \
6367
openjdk-${JRE_VERSION}-jdk-headless \
6468
ca-certificates \
6569
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
6670

71+
RUN ARCH=$(if [ "$(dpkg --print-architecture)" = "arm64" ]; then echo "aarch64"; else echo "$(dpkg --print-architecture)"; fi) \
72+
&& wget -q https://github.com/moparisthebest/static-curl/releases/download/v8.11.0/curl-$ARCH -O /usr/bin/curl \
73+
&& chmod +x /usr/bin/curl \
74+
&& curl --version
75+
6776
RUN --mount=type=secret,id=SEL_PASSWD \
6877
if [ "${TARGETARCH}" = "arm" ] && [ "${TARGETVARIANT}" = "v7" ]; then \
6978
export ARCH=armhf ; \

docker-compose-v2-tracing.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ services:
1515
- selenium-hub
1616
environment:
1717
- SE_EVENT_BUS_HOST=selenium-hub
18-
- SE_EVENT_BUS_PUBLISH_PORT=4442
19-
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
2018
- SE_ENABLE_TRACING=true
2119
- SE_OTEL_TRACES_EXPORTER=otlp
2220
- SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317
@@ -30,8 +28,6 @@ services:
3028
- selenium-hub
3129
environment:
3230
- SE_EVENT_BUS_HOST=selenium-hub
33-
- SE_EVENT_BUS_PUBLISH_PORT=4442
34-
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
3531
- SE_ENABLE_TRACING=true
3632
- SE_OTEL_TRACES_EXPORTER=otlp
3733
- SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317
@@ -45,8 +41,6 @@ services:
4541
- selenium-hub
4642
environment:
4743
- SE_EVENT_BUS_HOST=selenium-hub
48-
- SE_EVENT_BUS_PUBLISH_PORT=4442
49-
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
5044
- SE_ENABLE_TRACING=true
5145
- SE_OTEL_TRACES_EXPORTER=otlp
5246
- SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317

docker-compose-v2.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ services:
1010
- selenium-hub
1111
environment:
1212
- SE_EVENT_BUS_HOST=selenium-hub
13-
- SE_EVENT_BUS_PUBLISH_PORT=4442
14-
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
1513
ports:
1614
- "6900:5900"
1715

@@ -22,8 +20,6 @@ services:
2220
- selenium-hub
2321
environment:
2422
- SE_EVENT_BUS_HOST=selenium-hub
25-
- SE_EVENT_BUS_PUBLISH_PORT=4442
26-
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
2723
ports:
2824
- "6901:5900"
2925

@@ -34,8 +30,6 @@ services:
3430
- selenium-hub
3531
environment:
3632
- SE_EVENT_BUS_HOST=selenium-hub
37-
- SE_EVENT_BUS_PUBLISH_PORT=4442
38-
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
3933
ports:
4034
- "6902:5900"
4135

docker-compose-v3-full-grid-swarm.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ services:
1111
shm_size: 2gb
1212
environment:
1313
- SE_EVENT_BUS_HOST=selenium-hub
14-
- SE_EVENT_BUS_PUBLISH_PORT=4442
15-
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
1614
deploy:
1715
replicas: 1
1816
entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh'
@@ -22,8 +20,6 @@ services:
2220
shm_size: 2gb
2321
environment:
2422
- SE_EVENT_BUS_HOST=selenium-hub
25-
- SE_EVENT_BUS_PUBLISH_PORT=4442
26-
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
2723
deploy:
2824
replicas: 1
2925
entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh'
@@ -33,8 +29,6 @@ services:
3329
shm_size: 2gb
3430
environment:
3531
- SE_EVENT_BUS_HOST=selenium-hub
36-
- SE_EVENT_BUS_PUBLISH_PORT=4442
37-
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
3832
deploy:
3933
replicas: 1
4034
entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh'

docker-compose-v3-swarm.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ services:
1111
shm_size: 2gb
1212
environment:
1313
- SE_EVENT_BUS_HOST=selenium-hub
14-
- SE_EVENT_BUS_PUBLISH_PORT=4442
15-
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
1614
deploy:
1715
replicas: 1
1816
entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh'
@@ -22,8 +20,6 @@ services:
2220
shm_size: 2gb
2321
environment:
2422
- SE_EVENT_BUS_HOST=selenium-hub
25-
- SE_EVENT_BUS_PUBLISH_PORT=4442
26-
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
2723
deploy:
2824
replicas: 1
2925
entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh'
@@ -33,8 +29,6 @@ services:
3329
shm_size: 2gb
3430
environment:
3531
- SE_EVENT_BUS_HOST=selenium-hub
36-
- SE_EVENT_BUS_PUBLISH_PORT=4442
37-
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
3832
deploy:
3933
replicas: 1
4034
entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh'

tests/charts/make/chart_setup_env.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
echo "Set ENV variables"
44
CLUSTER=${CLUSTER:-"minikube"}
55
DOCKER_VERSION=${DOCKER_VERSION:-""}
6+
DOCKER_ENABLE_QEMU=${DOCKER_ENABLE_QEMU:-"true"}
67
HELM_VERSION=${HELM_VERSION:-"latest"}
78
KUBERNETES_VERSION=${KUBERNETES_VERSION:-$(curl -L -s https://dl.k8s.io/release/stable.txt)}
89

@@ -49,11 +50,8 @@ fi
4950
docker version
5051
docker buildx version
5152
docker buildx use default || true
52-
if [ "$(dpkg --print-architecture)" = "amd64" ]; then
53-
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes --credential yes ;
54-
else
55-
docker run --rm --privileged aptman/qus -- -r ;
56-
docker run --rm --privileged aptman/qus -s -- -p
53+
if [ "${DOCKER_ENABLE_QEMU}" = "true" ]; then
54+
docker run --privileged --rm tonistiigi/binfmt --install all ;
5755
fi
5856
docker info
5957
echo "==============================="

tests/docker-compose-v3-test-node-relay.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ services:
99
- ./videos/relay_config.toml:/opt/selenium/config.toml
1010
environment:
1111
- SE_EVENT_BUS_HOST=selenium-hub
12-
- SE_EVENT_BUS_PUBLISH_PORT=4442
13-
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
1412
- SE_LOG_LEVEL=${LOG_LEVEL}
1513
- GENERATE_CONFIG=false
1614

@@ -58,8 +56,6 @@ services:
5856
- emulator
5957
environment:
6058
- SE_EVENT_BUS_HOST=selenium-hub
61-
- SE_EVENT_BUS_PUBLISH_PORT=4442
62-
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
6359
- SE_LOG_LEVEL=${LOG_LEVEL}
6460
- SE_NODE_SESSION_TIMEOUT=${SESSION_TIMEOUT}
6561
- SE_NODE_RELAY_URL=http://emulator:4723

0 commit comments

Comments
 (0)