Hi Cafe,_______________________________________________I am trying to set up a useful development container for an open source project I am working on. I have created an image on top of the official Haskell image, expecting a proper installation of ghcup, cabal, stack and hls. The Dockerfile looks like this:FROM haskell:8.10ARG USERNAME=vscodeENV USERNAME=${USERNAME} \USER_UID=1000 \USER_GID=1000 \DEBIAN_FRONTEND=noninteractive \LANG=C.UTF8 \WDIR=/home/${USERNAME}RUN apt-get update && \apt-get upgrade -y && \apt-get install -y gitRUN groupadd --gid $USER_GID $USERNAME && \useradd -ms /bin/bash -K MAIL_DIR=/dev/null --uid $USER_UID --gid $USER_GID -m $USERNAME && \mkdir -p /etc/sudoers.d && \echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME && \chmod 0440 /etc/sudoers.d/$USERNAMEUSER ${USER_UID}:${USER_GID}WORKDIR ${WDIR}RUN stack update# Add just the .cabal file to capture dependenciesCOPY ./package.yaml ${WDIR}/package.yamlCOPY ./stack.yaml ${WDIR}/stack.yaml# Docker will cache this command as a layer, freeing us up to# modify source code without re-installing dependencies# (unless one of the copied files changes!)RUN stack build --only-dependencies -j4COPY . ${WDIR}ENV DEBIAN_FRONTEND=dialogENTRYPOINT ["/bin/bash"]The above image is built and pushed to dockerhub. Then, in the vscode project, I have a .devcontainer directory with the following Dockerfile:FROM ampersandtarski/ampersand-devcontainer:latestENV DEBIAN_FRONTEND=dialogENTRYPOINT ["/bin/bash"]The idea is that all the building of the dependencies is already done in the first image. That takes a lot of time, so this is supposed to be a great timesaver (though the image itself is huge).However, when I open the project inside the container, I get the following error:If I reload the window, I get the following errors:Long story short, I am not sure how to use the official Haskell image for development in my project. I must be missing something. I have been trying lots of things, but without succes. I hope it is possible to have an image built on top of the official Haskell file that contains all prebuilt dependencies of my project. Are my expectations realistic? If so, what am I missing?Any help is much appreciated.
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.