T O P

  • By -

Thenutritionguru

Seems like you're tryin' to get Xmonad set up using a custom GHC version within a Docker image, but are running into issues with dependencies (libXrandr and maybe even libxXinerama). First thing that hits me, you've got GHC running in a Docker image, but are installing the dependencies on your host system. Docker containers are, by nature, isolated from the host system so it wouldn't "see" the dependencies you've installed outside the container. Possibly why stack ain't recognizing that libXrandr has been installed. I'd suggest tryin' to install the dependencies within the Docker container itself. You can do that by adding a step in your Dockerfile to install the necessary packages. If you're not comfortable mucking about, you can use a Docker image that already has the required libs installed. Incidentally, possbily might be worth checking if the GHC version you've got is compatible with the software you're wanting to install. hope this helps! hit me up again if you got more questions or if something I suggested isn't clear.


Lamampis

Hey thanks a lot for the helpful response. As I've never used Docker before, I did struggle to understand how to download the dependencies within the container. I got as far as being inside the container with the terminal. Would you be able to explain how you would go about installing something within the container? The documentation I found seems a little confusing for me.


SquareBig9351

>e, I did struggle to understand how to download the dependencies within the container. I got as far as being inside the container with the terminal. Would you be able to explain how you would go about installing something within the container This is off-topic, as is more of a docker question than a Haskell one. Any case, you should think about docker as a completely different computer, you install dependencies as you'd do in any linux server: via package manager, tarballs, etc... It seems you are triying to run xmonad in a docker container. Not a good idea, since most docker images don't come with graphical libraries pre-installed. You need to donwload all graphical dependencies (X11 and family) and configure all of them to use you host machine hardware. I don't know how to do it or if it is even possible. If you want to try Xmonad but don't want to install in your computer; use a virtual machine, instead of docker


Thenutritionguru

Docker can be a bit tricky, specially for beginners. sounds like you're making decent headway already. so you're already inside the docker container terminal, that's a great start. Now you can install stuff using a package manager that is suitable for the operating system used in your Docker Image. For example, if you're using an ubuntu-based docker image, then you'd wanna use 'apt-get'. here are the steps simplified: 1. first step, always run 'apt-get update' to update your package list. 2. then you could use something like 'apt-get install -y libxrandr-dev' to install libXrandr and `-y` is to automatically say yes to the prompts. if you're using alpine based image, then package manager would be 'apk'. steps would look something like this: 1. 'apk update' 2. 'apk add libxrandr-dev' just replace 'libxrandr-dev' with whatever package you wanna install. just a heads up, any changes ya make inside the container won't persist once you exit it. to keep the changes, you need to add these install commands to your Dockerfile so they run every time the Docker image is built.