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

Use multi-stage build in Dockerfile #595

Merged
merged 4 commits into from
Oct 10, 2024
Merged

Use multi-stage build in Dockerfile #595

merged 4 commits into from
Oct 10, 2024

Conversation

Gnuxie
Copy link
Member

@Gnuxie Gnuxie commented Oct 4, 2024

Fixes #300

I also tried to use alpine again but rust-crypto is still fucky

with gcompat:

/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/index.js:250
    throw loadError
    ^

Error: Error relocating /node_modules/@matrix-org/matrix-sdk-crypto-nodejs/matrix-sdk-crypto.linux-x64-musl.node: __register_atfork: symbol not found
    at Module._extensions..node (node:internal/modules/cjs/loader:1586:18)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/index.js:175:31)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12) {
  code: 'ERR_DLOPEN_FAILED'
}

without gcompat:

/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/index.js:250
    throw loadError
    ^

Error: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /node_modules/@matrix-org/matrix-sdk-crypto-nodejs/matrix-sdk-crypto.linux-x64-musl.node)
    at Module._extensions..node (node:internal/modules/cjs/loader:1586:18)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/index.js:175:31)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12) {
  code: 'ERR_DLOPEN_FAILED'
}

Testing was done locally by using docker run --rm -it --network=host -v "/home/user/experiments/Draupnir/test/harness/mjolnir-data:/data" --name=draupnir draupnir-multi-stage bot --draupnir-config /data/config/production.yaml

Dockerfile Outdated Show resolved Hide resolved
@MTRNord
Copy link
Collaborator

MTRNord commented Oct 7, 2024

Hm I think you can then remove the version steps in the CI workflows right? 🤔

@Gnuxie
Copy link
Member Author

Gnuxie commented Oct 9, 2024

Hm I think you can then remove the version steps in the CI workflows right? 🤔

nah, we don't use the Dockerfile. OH right for release? yeah

@Gnuxie
Copy link
Member Author

Gnuxie commented Oct 9, 2024

@MTRNord I think we just leave at this for now and improve later, what do you think?

@MTRNord
Copy link
Collaborator

MTRNord commented Oct 9, 2024

@MTRNord I think we just leave at this for now and improve later, what do you think?

sure. Whatever works for you :) making good DraupnirDockerimages is hard anyway.

@Gnuxie Gnuxie merged commit b13b615 into main Oct 10, 2024
6 checks passed
@Gnuxie Gnuxie deleted the gnuxie/dockerfile-fun branch October 10, 2024 08:35
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.

Running docker build without supplying version.txt in the repo will fail because git isnt in the image
2 participants