Problem with building the singularity container of the "r-text" environment - r-text

I am using Ubuntu and the singularity command to build the "r-text" environment. But the terminal returned an error message.
+ apt-get install -y --no-install-recommends r-base=4.1.3* r-base-core=4.1.3* r-base-dev=4.1.3* r-recommended=4.1.3* r-base-html=4.1.3* r-doc-html=4.1.3* libcurl4-openssl-dev libssl-dev libxml2-dev libcairo2-dev libxt-dev libopenblas-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Selected version '4.1.3-1.2004.0' (CRAN:20.04/focal-cran40 [all]) for 'r-base'
Selected version '4.1.3-1.2004.0' (CRAN:20.04/focal-cran40 [amd64]) for 'r-base-core'
Selected version '4.1.3-1.2004.0' (CRAN:20.04/focal-cran40 [all]) for 'r-base-dev'
Selected version '4.1.3-1.2004.0' (CRAN:20.04/focal-cran40 [all]) for 'r-recommended'
Selected version '4.1.3-1.2004.0' (CRAN:20.04/focal-cran40 [all]) for 'r-base-html'
Selected version '4.1.3-1.2004.0' (CRAN:20.04/focal-cran40 [all]) for 'r-doc-html'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
r-recommended : Depends: r-cran-cluster (>= 1.9.6-2) but it is not going to be installed
Depends: r-cran-lattice (>= 0.10.11) but it is not going to be installed
Depends: r-cran-mgcv (>= 1.1.5) but it is not going to be installed
Depends: r-cran-nlme (>= 3.1.52) but it is not going to be installed
Depends: r-cran-rpart (>= 3.1.20) but it is not going to be installed
Depends: r-cran-survival (>= 2.13.2-1) but it is not going to be installed
Depends: r-cran-mass but it is not going to be installed
Depends: r-cran-class but it is not going to be installed
Depends: r-cran-nnet but it is not going to be installed
Depends: r-cran-matrix but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
FATAL: While performing build: while running engine: exit status 100
The singularity def file I am using is the following. It is the same as in the link. The only difference is I am trying to install "dplyr".
Bootstrap: docker
From: ubuntu:20.04
%environment
export LANG=C.UTF-8 LC_ALL=C.UTF-8
export XDG_RUNTIME_DIR=/tmp/.run_$(uuidgen)
%post
# Install
apt-get -y update
export R_VERSION=4.1.3
echo "export R_VERSION=${R_VERSION}" >> $SINGULARITY_ENVIRONMENT
# Install R
apt-get update
apt-get install -y --no-install-recommends software-properties-common dirmngr wget uuid-runtime
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | \
tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
add-apt-repository \
"deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
apt-get install -y --no-install-recommends \
r-base=${R_VERSION}* \
r-base-core=${R_VERSION}* \
r-base-dev=${R_VERSION}* \
r-recommended=${R_VERSION}* \
r-base-html=${R_VERSION}* \
r-doc-html=${R_VERSION}* \
libcurl4-openssl-dev \
libssl-dev \
libxml2-dev \
libcairo2-dev \
libxt-dev \
libopenblas-dev
# Add a default CRAN mirror
echo "options(repos = c(CRAN = 'https://cran.rstudio.com/'), download.file.method = 'libcurl')" >> /usr/lib/R/etc/Rprofile.site
# Fix R package libpaths (helps RStudio Server find the right directories)
mkdir -p /usr/lib64/R/etc
echo "R_LIBS_USER='/usr/lib64/R/library'" >> /usr/lib64/R/etc/Renviron
echo "R_LIBS_SITE='${R_PACKAGE_DIR}'" >> /usr/lib64/R/etc/Renviron
# Clean up
rm -rf /var/lib/apt/lists/*
# Install python3
apt-get -y install python3 wget
apt-get -y clean
# Install Miniconda
cd /
wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p /miniconda
/bin/bash <<EOF
rm Miniconda3-latest-Linux-x86_64.sh
source /miniconda/etc/profile.d/conda.sh
conda update -y conda
# Install reticulate and text
Rscript -e 'install.packages("reticulate")'
Rscript -e 'install.packages("devtools")'
Rscript -e 'install.packages("dplyr")'
Rscript -e 'install.packages("glmnet")'
Rscript -e 'devtools::install_github("oscarkjell/text")'
# Create the Conda environment at a system folder
Rscript -e 'text::textrpp_install(prompt = FALSE)'
Rscript -e 'text::textrpp_initialize(save_profile = TRUE, prompt = FALSE, textEmbed_test = TRUE)'
EOF
I have tried. Just wait for possible solutions.

I have used the following .def file to solve the issue.
Bootstrap: docker
From: ubuntu:20.04
%environment
export LANG=C.UTF-8 LC_ALL=C.UTF-8
export XDG_RUNTIME_DIR=/tmp/.run_$(uuidgen)
%post
# Install
apt-get -y update
export R_VERSION=4.2.2
echo "export R_VERSION=${R_VERSION}" >> $SINGULARITY_ENVIRONMENT
# Install R
apt-get update
apt-get install -y --no-install-recommends software-properties-common dirmngr wget uuid-runtime
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | \
tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
add-apt-repository \
"deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
apt-get install -y --no-install-recommends \
r-base=${R_VERSION}* \
r-base-core=${R_VERSION}* \
r-base-dev=${R_VERSION}* \
r-recommended=${R_VERSION}* \
r-base-html=${R_VERSION}* \
r-doc-html=${R_VERSION}* \
libcurl4-openssl-dev \
libharfbuzz-dev \
libfribidi-dev \
libgit2-dev \
libxml2-dev \
libfontconfig1-dev \
libssl-dev \
libxml2-dev \
libfreetype6-dev \
libpng-dev \
libtiff5-dev \
libjpeg-dev
# Add a default CRAN mirror
echo "options(repos = c(CRAN = 'https://cran.rstudio.com/'), download.file.method = 'libcurl')" >> /usr/lib/R/etc/Rprofile.site
# Fix R package libpaths (helps RStudio Server find the right directories)
mkdir -p /usr/lib64/R/etc
echo "R_LIBS_USER='/usr/lib64/R/library'" >> /usr/lib64/R/etc/Renviron
echo "R_LIBS_SITE='${R_PACKAGE_DIR}'" >> /usr/lib64/R/etc/Renviron
# Clean up
rm -rf /var/lib/apt/lists/*
# Install python3
apt-get -y install python3 wget
apt-get -y clean
# Install Miniconda
cd /
wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p /miniconda
/bin/bash <<EOF
rm Miniconda3-latest-Linux-x86_64.sh
source /miniconda/etc/profile.d/conda.sh
conda update -y conda
# Install reticulate and text
Rscript -e 'install.packages("pkgdown")'
Rscript -e 'install.packages("ragg")'
Rscript -e 'install.packages("textshaping")'
Rscript -e 'install.packages("reticulate")'
Rscript -e 'install.packages("devtools")'
Rscript -e 'install.packages("glmnet")'
Rscript -e 'install.packages("tidyverse")'
# Rscript -e 'install.packages("text")'
Rscript -e 'devtools::install_github("oscarkjell/text")'
# Create the Conda environment at a system folder
Rscript -e 'text::textrpp_install(prompt = FALSE, rpp_version = c("torch==1.11.0", "transformers==4.19.2", "numpy", "nltk"))'
Rscript -e 'text::textrpp_initialize(save_profile = TRUE, prompt = FALSE, textEmbed_test = TRUE)'
Rscript -e 'text::textEmbed("hello", model = "distilbert-base-uncased", layers = 5)'
Rscript -e 'text::textEmbed("hello", model = "roberta-base", layers = 11)'

Related

GCC compilation within docker with "-j"

I got strange errors while compiling my project within the docker container when I am using -j option of make.
The errors look like this:
/root/projects/obj/linux_debug/src/myos_make/libmyos.a: error adding symbols: Cannot allocate memory
/usr/protobuf-3.9.2/lib/libprotobuf.a: error adding symbols: Bad address
Compiling the same project inside the container without -j and outside the container with -j passes ok.
The Dockerfile :
#
# This docker must be built from projects/src folder as context
#
FROM ubuntu:18.04 as base
# copy the dockerfile to make it possible to keep track of the cntent of the image
COPY ./docker_build/docker_files/Dockerfile.ubuntu18.04-builder $HOME/.
# Disable Prompt During Packages Installation
ARG DEBIAN_FRONTEND=noninteractive
# Update Ubuntu Software repository
RUN apt update -y && apt upgrade -y
# Install base utils
RUN apt install -y \
nano \
wget \
sudo \
curl \
&& apt clean -y
# Install additional packages needed for build.
RUN apt install -y \
nasm \
pkg-config \
bc \
python \
python3 \
python3-pip \
sshpass \
libapr1 \
libapr1-dev \
&& apt clean -y
RUN apt install -y \
rpm \
libaio-dev \
libnuma-dev \
numactl \
valgrind \
openssl \
libssl-dev \
ldap-utils \
libldap2-dev \
libncurses5-dev \
libncursesw5-dev \
uuid-dev \
ncurses-base \
expat \
libfuse-dev \
cmake \
build-essential \
autotools-dev \
autoconf \
automake \
doxygen \
linux-headers-4.15.0-173-generic \
g++-multilib \
lib32z1-dev \
libasan4 \
software-properties-common \
libtool \
unzip \
xsltproc \
&& apt clean -y
RUN ln -s /usr/bin/doxygen /bin/doxygen
# install GCC compiler
RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y \
&& apt update -y\
&& apt install gcc-10 -y \
&& apt install g++-10 -y \
&& apt clean -y && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 60 --slave /usr/bin/g++ g++ /usr/bin/g++-10 && \
update-alternatives --config gcc
RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py && \
python get-pip.py
RUN ln -sf /usr/local/bin/pip2 /usr/bin/pip
RUN pip install \
pyyaml \
jinja2 \
gcovr
FROM base as env-prepare
COPY external/protobuf /protobuf
RUN cd protobuf && ./build_proto.sh
FROM base as builder
COPY --from=env-prepare /usr/protobuf-3.9.2/ /usr/protobuf-3.9.2/
COPY --from=env-prepare /usr/protobuf-c-1.3.2/ /usr/protobuf-c-1.3.2/
COPY docker_build/docker-image-release /etc/docker-image-release
ARG UID=1000
USER ${UID}
# This entrypoint is to make everything run inside bash, so the devtools script will alway run before the command
ENTRYPOINT [ "/bin/bash", "-c" ]

Shiny app (leafviz) in docker container not loading in browser

I am building a docker container to use the Leafcutter and Leafviz analysis tools. The final visualization commanded from an R file uses shiny app, it works fine on my machine but when ran in the container I can't connect to it.
I run the container with the following line of code:
docker run -dit --name leaf --rm -p 1234:1234 leafcutter
All is in order when I check with docker ps:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
783f550df965 leafcutter "bash" 2 minutes ago Up 2 minutes 0.0.0.0:1234->1234/tcp, :::1234->1234/tcp leaf
Executing the pipeline in the container calls several snakefiles, and the last rule of the last one calls the R file:
Rscript /path/to/run_leafviz.R -i {input}
That script calls several functions before calling leafviz() which basically just runs the shiny app, I've modified the options like so:
shiny::runApp(launch.browser=FALSE, appDir = system.file("application", package = "leafviz"), host = "0.0.0.0", port = 1234)
All the shiny files and packages are installed with the R leafviz package. When I execute my container all goes fine, the output shows "Listening on http://0.0.0.0:1234", but when I try to connect I get the "connexion failed" page.
My Dockerfile is fairly large but here are the most relevant parts:
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND noninteractive
#Install Ubuntu packages
RUN apt-get update && apt-get install \
-y cmake -y curl \
-y default-jre \
-y gdebi-core \
-y less -y libarchive13 -y libbz2-dev -y libcairo2-dev -y libcurl4-openssl-dev -y libgsl-dev \
-y liblzma-dev -y libncurses5-dev -y libncursesw5-dev -y libssl-dev -y libxml2-dev -y libxt-dev \
-y pandoc -y pandoc-citeproc -y python-pip \
-y tabix \
-y unzip \
-y wget \
-y zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
#Install conda, snakemake, samtools, regtools...
#[...]
#Install R
LABEL org.label-schema.license="GPL-2.0" \
org.label-schema.vcs-url="https://github.com/rocker-org/r-apt" \
org.label-schema.vendor="Rocker Project" \
maintainer="Dirk Eddelbuettel <edd#debian.org>"
RUN useradd docker \
&& mkdir /home/docker \
&& chown docker:docker /home/docker \
&& addgroup docker staff
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
littler r-base r-base-dev r-recommended r-cran-docopt
RUN ln -s /usr/lib/R/site-library/littler/examples/install.r /usr/local/bin/install.r \
&& ln -s /usr/lib/R/site-library/littler/examples/install2.r /usr/local/bin/install2.r \
&& ln -s /usr/lib/R/site-library/littler/examples/installGithub.r /usr/local/bin/installGithub.r \
&& ln -s /usr/lib/R/site-library/littler/examples/testInstalled.r /usr/local/bin/testInstalled.r \
&& rm -rf /tmp/downloaded_packages/ /tmp/*.rds \
&& rm -rf /var/lib/apt/lists/*
#Install shiny server (I have tried with and without this RUN command)
RUN wget --no-verbose https://s3.amazonaws.com/rstudio-shiny-server-os-build/ubuntu-12.04/x86_64/VERSION -O "version.txt" && \
VERSION=$(cat version.txt) && \
wget --no-verbose "https://s3.amazonaws.com/rstudio-shiny-server-os-build/ubuntu-12.04/x86_64/shiny-server-$VERSION-amd64.deb" -O ss-latest.deb && \
gdebi -n ss-latest.deb && \
rm -f version.txt ss-latest.deb
EXPOSE 1234
#Install R packages
COPY install_packages.R /tmp/install_packages.R
RUN Rscript /tmp/install_packages.R
CMD ["bash"]
I've been learning docker quite chaotically so I don't know if some elements are clashing, but I have exposed the container port and published it to the host and no error message seems to indicate there is a problem coming from somewhere else. I would really appreciate some help.

Installing haskell's cabal or ghcup inside a dockerfile wont work

This is my dockerfile for haskell:
FROM ubuntu:focal
RUN apt-get update && apt-get install -y build-essential curl \
libffi-dev libffi7 libgmp-dev libgmp10 \
libncurses-dev libncurses5 libtinfo5
ENV BOOTSTRAP_HASKELL_NONINTERACTIVE=1
RUN sh -c "curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh"
RUN sh -c "curl -sSL https://get.haskellstack.org/ | sh"
even though it install ghcup I cannot run cabal neither ghcup.
What is wrong?
Even running this inside the docker container in bash will say
[ Warn ] Cabal ver 3.4.0.0 already installed; if you really want to reinstall it, you may want to run 'ghcup rm cabal 3.4.0.0' first
but I cannot launch cabal or ghcup.
ghcup maintainer here.
I recommend to use ghcup as follows in Docker, which will not require messing with PATH:
FROM ubuntu:focal
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Berlin
# install dependencies
RUN \
apt-get update -y && \
apt-get install -y --no-install-recommends \
curl \
libnuma-dev \
zlib1g-dev \
libgmp-dev \
libgmp10 \
git \
wget \
lsb-release \
software-properties-common \
gnupg2 \
apt-transport-https \
gcc \
autoconf \
automake \
build-essential
# install gpg keys
ARG GPG_KEY=7784930957807690A66EBDBE3786C5262ECB4A3F
RUN gpg --batch --keyserver keys.openpgp.org --recv-keys $GPG_KEY
# install ghcup
RUN \
curl https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > /usr/bin/ghcup && \
chmod +x /usr/bin/ghcup && \
ghcup config set gpg-setting GPGStrict
ARG GHC=8.10.7
ARG CABAL=latest
# install GHC and cabal
RUN \
ghcup -v install ghc --isolate /usr/local --force ${GHC} && \
ghcup -v install cabal --isolate /usr/local/bin --force ${CABAL}
You can read about isolated installations here.
You have to include their paths to PATH in order to be discoverable.
In addition, I prefer to use bash instead of sh.
This one is working as expected and note the two different ways to declare ENV variables as also some common commands:
FROM debian:stable-slim as build
# Install dependencies *You don't need all of them
RUN apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y git jq bc make automake libnuma-dev \
&& apt-get install -y rsync htop curl build-essential \
&& apt-get install -y pkg-config libffi-dev libgmp-dev \
&& apt-get install -y libssl-dev libtinfo-dev libsystemd-dev \
&& apt-get install -y zlib1g-dev make g++ wget libncursesw5 libtool autoconf \
&& apt-get clean
# Install ghcup
ENV BOOTSTRAP_HASKELL_NONINTERACTIVE=1
RUN bash -c "curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh"
RUN bash -c "curl -sSL https://get.haskellstack.org/ | sh"
# Add ghcup to PATH
ENV PATH=${PATH}:/root/.local/bin
ENV PATH=${PATH}:/root/.ghcup/bin
# Install cabal
RUN bash -c "ghcup upgrade"
RUN bash -c "ghcup install cabal 3.4.0.0"
RUN bash -c "ghcup set cabal 3.4.0.0"
# Install GHC
RUN bash -c "ghcup install ghc 8.10.4"
RUN bash -c "ghcup set ghc 8.10.4"
# Update Path to include Cabal and GHC exports
RUN bash -c "echo PATH="$HOME/.local/bin:$PATH" >> $HOME/.bashrc"
RUN bash -c "echo export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" >> $HOME/.bashrc"
RUN bash -c "source $HOME/.bashrc"
# Update cabal
RUN bash -c "cabal update"

node installed in docker container but not npm

I have this DockerFile
FROM docker:17.12.0-ce as static-docker-source
FROM ubuntu:18.04
FROM python:3.8-slim-buster
ARG CLOUD_SDK_VERSION=335.0.0
ENV CLOUD_SDK_VERSION=$CLOUD_SDK_VERSION
ENV PATH "$PATH:/opt/google-cloud-sdk/bin/"
COPY --from=static-docker-source /usr/local/bin/docker /usr/local/bin/docker
RUN apt-get -qqy update && apt-get install -qqy \
curl \
gcc \
apt-transport-https \
lsb-release \
openssh-client \
git \
gnupg && \
pip install crcmod && \
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" && \
echo "deb https://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" > /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \
apt-get update && \
apt-get install -y google-cloud-sdk=${CLOUD_SDK_VERSION}-0 \
google-cloud-sdk-app-engine-python=${CLOUD_SDK_VERSION}-0 \
google-cloud-sdk-app-engine-python-extras=${CLOUD_SDK_VERSION}-0 \
google-cloud-sdk-cbt=${CLOUD_SDK_VERSION}-0 \
kubectl && \
gcloud --version && \
docker --version && kubectl version --client
VOLUME ["/root/.config"]
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN curl -sL https://sentry.io/get-cli/ | bash -
RUN apt-get install -y nodejs build-essential pkg-config libcairo2-dev libjpeg-dev libgif-dev
ADD requirements.txt /
ADD requirements-prod.txt /
ADD submodules /
RUN python --version
RUN pip3 install --upgrade pip
RUN pip3 install -r /requirements.txt
RUN pip3 install -r /requirements-prod.txt
when I run node --version it returns v10.24.0 (I think it should be 8.x.y ....).
And when I run npm --version it returns bash: npm: command not found
Shouldn't node install npm too ?
Thanks
So I fixed it by changing my DockerFile.
I deleted FROM python:3.8-slim-buster as I read that having multiple 'FROM' on a dockerfile could cause conflict. And I installed python with apt like this:
RUN apt-get -qqy update && apt-get install -qqy \
curl \
gcc \
python3.8 \
python3-pip \
python3.8-dev \
However, it is not perfect to me because I now have python3.6.x under python 3, python 2.7.x under python and I must specified python3.8 when I need it...
My new DockerFile:
FROM docker:17.12.0-ce as static-docker-source
FROM ubuntu:18.04
ARG CLOUD_SDK_VERSION=335.0.0
ENV CLOUD_SDK_VERSION=$CLOUD_SDK_VERSION
ENV PATH "$PATH:/opt/google-cloud-sdk/bin/"
COPY --from=static-docker-source /usr/local/bin/docker
/usr/local/bin/docker
RUN apt-get -qqy update && apt-get install -qqy \
curl \
gcc \
python3.8 \
python3-pip \
python3.8-dev \
apt-transport-https \
lsb-release \
openssh-client \
git \
gnupg && \
pip3 install crcmod && \
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" && \
echo "deb https://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" > /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \
apt-get update && \
apt-get install -y google-cloud-sdk=${CLOUD_SDK_VERSION}-0 \
google-cloud-sdk-app-engine-python=${CLOUD_SDK_VERSION}-0 \
google-cloud-sdk-app-engine-python-extras=${CLOUD_SDK_VERSION}-0 \
google-cloud-sdk-cbt=${CLOUD_SDK_VERSION}-0 \
kubectl && \
gcloud --version && \
docker --version && kubectl version --client
VOLUME ["/root/.config"]
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN curl -sL https://sentry.io/get-cli/ | bash -
RUN apt-get install -y nodejs build-essential pkg-config libcairo2-dev
libjpeg-dev libgif-dev
RUN node --version
RUN npm --version
RUN python --version
ADD requirements.txt /
ADD requirements-prod.txt /
ADD submodules /
RUN python --version
RUN pip3 install --upgrade pip
RUN pip3 install -r /requirements.txt
RUN pip3 install -r /requirements-prod.txt

wkhtmltopdf giving error inside the docker container

I am getting the following error inside my docker container:
How can I update my dockerfile, so that while building the container it builds with a version of wkhtmltopdf with patched Qt.
Following is my dockerfile:
...
RUN apt-get install -y wkhtmltopdf
RUN apt-get install -y xvfb
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
...
Installing the following dependencies with wkhtmltopdf worked out for me:
...
RUN apt-get update
RUN apt-get install -y xvfb
RUN apt-get install -y wget
RUN apt-get install -y openssl build-essential xorg libssl1.0-dev
RUN wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
RUN tar xvJf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
RUN cp wkhtmltox/bin/wkhtmlto* /usr/bin/
...
FROM php:7.4-fpm
# Install dependencies, libssl1.1-dev ?
RUN apt-get update && apt-get install -y \
xvfb \
wget \
openssl \
xorg \
libssl1.1 \
build-essential \
libpng-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
locales \
zip \
jpegoptim optipng pngquant gifsicle \
vim \
unzip \
git \
curl \
libzip-dev \
dcmtk \
nginx \
supervisor
RUN wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
RUN tar xvJf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
RUN cp wkhtmltox/bin/wkhtmlto* /usr/bin/
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
COPY php.ini /usr/local/etc/php/php.ini
# adjustments to php.ini base on the production version.
# Install extensions and configure
RUN docker-php-ext-configure gd --with-freetype --with-jpeg
RUN docker-php-ext-configure zip
RUN docker-php-ext-install pdo_mysql zip exif pcntl gd sockets
# RUN sed -E -i -e 's/max_execution_time = 1200/max_execution_time = 120/' /etc/php.ini \
# && sed -E -i -e 's/memory_limit = 128M/memory_limit = 512M/' /etc/php.ini \
# && sed -E -i -e 's/post_max_size = 8M/post_max_size = 64M/' /etc/php.ini \
# && sed -E -i -e 's/upload_max_filesize = 2M/upload_max_filesize = 64M/' /etc/php.ini
# php artisan storage:link
# THAT NEEDS TO BE RUN FROM THE nginx-home/LaravelPortal/ directory to symlink the storage directory. NEED to figure out how to do that.
# sudo docker exec -it orthanc-docker-dev_ris_php-fpm_1 /bin/bash
COPY default.conf /etc/nginx/conf.d/default.conf
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY entrypoint.sh /
ENTRYPOINT ["/bin/bash","/entrypoint.sh"]

Resources