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

Change docker base image to alpine #834

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

koral--
Copy link
Member

@koral-- koral-- commented Feb 9, 2025

Fixes #820

@koral-- koral-- requested a review from denis99999 February 9, 2025 22:25
Copy link

@denis99999 denis99999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@koral-- , on arm64 system (Raspberry Pi5 - bookworm) it works fine, but on x86_64 system (debian buster 10.11) the generation of the Docker image works fine but at running step (local STF server) there is an exception on zeromq:

févr. 10 10:22:28 devstf-buster docker[9726]: 2025-02-10T09:22:28.247Z INF/util:procutil 1 [*] Forking "/app/lib/cli poorxy --port 80 --app-url http://localhost:7105/ --auth-url http://localhost:7120/ --api-url http://localhost:7106/ --websocket-url http://localhost:7110/ --storage-url http://localhost:7102/ --storage-plugin-image-url http://localhost:7103/ --storage-plugin-apk-url http://localhost:7104/"
févr. 10 10:22:29 devstf-buster docker[9726]: Failed to load addon at /app/node_modules/zeromq/build/linux/x64/node/115/addon.node: Error: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /app/node_modules/zeromq/build/linux/x64/node/115/addon.node)
févr. 10 10:22:29 devstf-buster docker[9726]: Error: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /app/node_modules/zeromq/build/linux/x64/node/115/addon.node)
févr. 10 10:22:29 devstf-buster docker[9726]:     at Object..node (node:internal/modules/cjs/loader:1725:18)
févr. 10 10:22:29 devstf-buster docker[9726]:     at Module.load (node:internal/modules/cjs/loader:1313:32)
févr. 10 10:22:29 devstf-buster docker[9726]:     at Function._load (node:internal/modules/cjs/loader:1123:12)
févr. 10 10:22:29 devstf-buster docker[9726]:     at TracingChannel.traceSync (node:diagnostics_channel:322:14)
févr. 10 10:22:29 devstf-buster docker[9726]:     at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
févr. 10 10:22:29 devstf-buster docker[9726]:     at Module.require (node:internal/modules/cjs/loader:1335:12)
févr. 10 10:22:29 devstf-buster docker[9726]:     at require (node:internal/modules/helpers:136:16)
févr. 10 10:22:29 devstf-buster docker[9726]:     at findAddon (/app/node_modules/zeromq/lib/load-addon.js:29:25)
févr. 10 10:22:29 devstf-buster docker[9726]:     at Object.<anonymous> (/app/node_modules/zeromq/lib/load-addon.js:50:15)
févr. 10 10:22:29 devstf-buster docker[9726]:     at Module._compile (node:internal/modules/cjs/loader:1562:14)
févr. 10 10:22:29 devstf-buster docker[9726]:     at Object..js (node:internal/modules/cjs/loader:1699:10)
févr. 10 10:22:29 devstf-buster docker[9726]:     at Module.load (node:internal/modules/cjs/loader:1313:32)
févr. 10 10:22:29 devstf-buster docker[9726]:     at Function._load (node:internal/modules/cjs/loader:1123:12)
févr. 10 10:22:29 devstf-buster docker[9726]:     at TracingChannel.traceSync (node:diagnostics_channel:322:14)
févr. 10 10:22:29 devstf-buster docker[9726]:     at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
févr. 10 10:22:29 devstf-buster docker[9726]:     at Module.require (node:internal/modules/cjs/loader:1335:12)

I note also with this Dockerfile we do not master the nodejs version!

@gounthar
Copy link

Regarding the nodejs version, we could go that way:

# Download and install a pinned version of Node.js
ARG NODE_VERSION=22.11.0
RUN ARCH=$(uname -m) && \
    if [ "$ARCH" = "x86_64" ]; then ARCH=linux-x64; elif [ "$ARCH" = "aarch64" ]; then ARCH=linux-arm64; else echo "Unsupported architecture: $ARCH"; exit 1; fi && \
    wget https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-${ARCH}.tar.xz && \
    tar -xJf node-v${NODE_VERSION}-${ARCH}.tar.xz -C /usr/local --strip-components=1 && \
    rm node-v${NODE_VERSION}-${ARCH}.tar.xz

@denis99999
Copy link

@koral-- I am on vacation, I will test that next week!

@denis99999
Copy link

@koral-- , I tested on x86_64, the build is OK but at running step there is an error:

mars 03 17:31:42 devstf-buster docker[19501]: 2025-03-03T16:31:42.137Z INF/util:procutil 1 [*] Forking "/app/lib/cli poorxy --port 80 --app-url http://localhost:7105/ --auth-url http://localhost:7120/ --api-url http://localhost:7106/ --websocket-url http://localhost:7110/ --storage-url http://localhost:7102/ --storage-plugin-image-url http://localhost:7103/ --storage-plugin-apk-url http://localhost:7104/"
mars 03 17:31:44 devstf-buster docker[19501]: 2025-03-03T16:31:44.540Z INF/poorxy 90 [*] Listening on port 80
mars 03 17:31:45 devstf-buster docker[19501]: 2025-03-03T16:31:45.645Z INF/storage:plugins:apk 87 [*] Listening on port 7104
mars 03 17:31:45 devstf-buster docker[19501]: 2025-03-03T16:31:45.676Z INF/storage:temp 69 [*] Listening on port 7102
mars 03 17:31:45 devstf-buster docker[19501]: 2025-03-03T16:31:45.753Z INF/app 51 [*] Using pre-built resources
mars 03 17:31:45 devstf-buster docker[19501]: 2025-03-03T16:31:45.768Z INF/app 51 [*] Listening on port 7105
mars 03 17:31:45 devstf-buster docker[19501]: 2025-03-03T16:31:45.764Z INF/auth-mock 50 [*] Listening on port 7120
mars 03 17:31:45 devstf-buster docker[19501]: 2025-03-03T16:31:45.778Z INF/db 51 [*] Connecting to 127.0.0.1:28015
mars 03 17:31:45 devstf-buster docker[19501]: 2025-03-03T16:31:45.780Z INF/db 50 [*] Connecting to 127.0.0.1:28015
mars 03 17:31:45 devstf-buster docker[19501]: 2025-03-03T16:31:45.835Z INF/storage:plugins:image 80 [*] Listening on port 7103
mars 03 17:32:39 devstf-buster systemd[1]: Started Run anacron jobs.
mars 03 17:32:39 devstf-buster anacron[19757]: Anacron 2.3 started on 2025-03-03
mars 03 17:32:39 devstf-buster anacron[19757]: Normal exit (0 jobs run)
mars 03 17:32:39 devstf-buster systemd[1]: anacron.service: Succeeded.
mars 03 17:32:45 devstf-buster docker[19501]: 2025-03-03T16:32:45.445Z ERR/poorxy 90 [*] Proxy had an error Error: connect ECONNREFUSED 127.0.0.1:7106
mars 03 17:32:45 devstf-buster docker[19501]:     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1634:16)
mars 03 17:32:45 devstf-buster docker[19501]: 2025-03-03T16:32:45.454Z ERR/poorxy 90 [*] Proxy had an error Error: connect ECONNREFUSED 127.0.0.1:7106
mars 03 17:32:45 devstf-buster docker[19501]:     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1634:16)

Do you have the same error on your side ?

@koral--
Copy link
Member Author

koral-- commented Mar 3, 2025

Indeed stf api invocation fails with segmentation fault on amd64. I'll debug it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing ARM based docker images on the devicefarmer/stf Dockerhub repository
3 participants