livebook-dev / livebook

Automate code & data workflows with interactive Elixir notebooks
https://livebook.dev
Apache License 2.0
4.86k stars 415 forks source link

Docker image fails running a Livebook on ubuntu: pkg-config missing for calling openssl #2695

Closed ndrean closed 3 months ago

ndrean commented 3 months ago

Environment

Docker, on Ubuntu.

Current behavior

I run

docker run -p 8080:8080 -p 8081:8081 --pull always ghcr.io/livebook-dev/livebook

When I compile the deps, I get an error on a package ex_dtls:

Fails with: Bundlex: 
Couldn't load OS dependency :openssl
Provider `:pkg_config` couldn't load ["openssl"] libraries with pkg-config due to:
    ** (BundlexError) pkg-config not found. Bundlex needs pkg-config to find packages in system.

This is not due to the package and I have openssl and pkg-config on the machine. I installed with mix escript.install hex livebook and the Livebook compiles.

Missing in Dockerfile?

Expected behavior

A short description on how you expect the code to behave.

josevalim commented 3 months ago

I believe you then need to build your own Dockerfile that adds any missing dependencies on top of Livebook. Or you emit commands such as System.cmd("apt-get", ["open-ssl"]) or similar directly from your notebook.

jonatanklosko commented 3 months ago

In this case you need apt-get update && apt-get install pkg-config libssl-dev, as Jose said, either in Dockerfile or in the notebook :)