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

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"

Related

Kartoza Geoserver on Heroku

I am new to docker and not an IT-specialist. I try to install Kartoza Geoserver in Docker on Heroku, but so far no success. Does anyone has experience with this and can explain me the settings in the dockerfile and the steps specifically for a Heroku install?
So far I tried a build with a modified dockerfile but I always get the same error (in the log trail) when opening/launching geoserver on Heroku:
"Error: groupadd: cannot open /etc/group".
I guess it is an permission/privileges issue.
Any sharing of experience on modifying the docker file so that the image is read by Heroku would be helpfull.
Modifying the settings in the dockerfile:
Removed the port forwarding from dockerfile
Add RUN adduser -D myuser USER myuser to dockerfile
Result dockerfile:
#--------- Generic stuff all our Dockerfiles should start with so we get caching ------------
ARG IMAGE_VERSION=9.0.65-jdk11-openjdk-slim-buster
ARG JAVA_HOME=/usr/local/openjdk-11
FROM tomcat:$IMAGE_VERSION
LABEL maintainer="Tim Sutton<tim#linfiniti.com>"
ARG GS_VERSION=2.22.0
ARG WAR_URL=https://downloads.sourceforge.net/project/geoserver/GeoServer/${GS_VERSION}/geoserver-${GS_VERSION}-war.zip
ARG STABLE_PLUGIN_BASE_URL=https://sourceforge.net/projects/geoserver/files/GeoServer
ARG DOWNLOAD_ALL_STABLE_EXTENSIONS=1
ARG DOWNLOAD_ALL_COMMUNITY_EXTENSIONS=1
ARG HTTPS_PORT=8443
ENV DEBIAN_FRONTEND=noninteractive
#Install extra fonts to use with sld font markers
RUN adduser -D myuser
USER myuser
RUN set -eux; \
apt-get update; \
apt-get -y --no-install-recommends install \
locales gnupg2 wget ca-certificates rpl pwgen software-properties-common iputils-ping \
apt-transport-https curl gettext fonts-cantarell lmodern ttf-aenigma \
ttf-bitstream-vera ttf-sjfonts tv-fonts libapr1-dev libssl-dev \
wget zip unzip curl xsltproc certbot cabextract gettext postgresql-client figlet gosu gdal-bin; \
# Install gdal3 - bullseye doesn't build libgdal-java anymore so we can't upgrade
curl https://deb.meteo.guru/velivole-keyring.asc | apt-key add - \
&& echo "deb https://deb.meteo.guru/debian buster main" > /etc/apt/sources.list.d/meteo.guru.list \
&& apt-get update \
&& apt-get -y --no-install-recommends install gdal-bin libgdal-java; \
dpkg-divert --local --rename --add /sbin/initctl \
&& (echo "Yes, do as I say!" | apt-get remove --force-yes login) \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*; \
# verify that the binary works
gosu nobody true
ENV \
JAVA_HOME=${JAVA_HOME} \
DEBIAN_FRONTEND=noninteractive \
GEOSERVER_DATA_DIR=/opt/geoserver/data_dir \
GDAL_DATA=/usr/share/gdal \
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/tomcat/native-jni-lib:/usr/lib/jni:/usr/local/apr/lib:/opt/libjpeg-turbo/lib64:/usr/lib:/usr/lib/x86_64-linux-gnu" \
FOOTPRINTS_DATA_DIR=/opt/footprints_dir \
GEOWEBCACHE_CACHE_DIR=/opt/geoserver/data_dir/gwc \
CERT_DIR=/etc/certs \
RANDFILE=/etc/certs/.rnd \
FONTS_DIR=/opt/fonts \
GEOSERVER_HOME=/geoserver \
EXTRA_CONFIG_DIR=/settings \
COMMUNITY_PLUGINS_DIR=/community_plugins \
STABLE_PLUGINS_DIR=/stable_plugins
WORKDIR /scripts
ADD resources /tmp/resources
ADD build_data /build_data
ADD scripts /scripts
RUN echo $GS_VERSION > /scripts/geoserver_version.txt ;\
chmod +x /scripts/*.sh;/scripts/setup.sh \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN echo 'figlet -t "Kartoza Docker GeoServer"' >> ~/.bashrc
WORKDIR ${GEOSERVER_HOME}
ENTRYPOINT ["/bin/bash", "/scripts/entrypoint.sh"]
Then build it with argument --platform linux/amd64 (I use arm64 architecture). Then pushed it to Heroku. All the time I get the same error.

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" ]

'DEBIAN_FRONTEND=noninteractive' not working inside shell script with apt-get

I'm buildinga a docker image using a Dockerfile to build it. I have put ARG DEBIAN_FRONTEND=noninteractive in the beginning of the Dockerfile to avoid debconf warnings while building.
The warnings does not show up when using apt-get install inside the Dockerfile. However when executing a sh script (install_dependencies.sh) from the Dockerfile that contains apt-get install commands, the warnings show up again. I also tried to set DEBIAN_FRONTEND=noninteractive inside the sh script itself.
I can solve this by adding echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections in the sh script before the apt-get install commands but I would want to avoid that, since any fail in the script would leave debconf select to Noninteractive.
Dockerfile:
FROM ubuntu:18.04
# Avoid warnings by switching to noninteractive
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /tmp
# Configure APT --> HERE THE WARNINGS 'debconf: unable to initialize frontend: Dialog' ARE NOT DISPLAYED
RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get install -y \
apt-utils \
dialog \
fakeroot \
software-properties-common \
2>&1
# Install APT packages --> HERE THE WARNINGS 'debconf: unable to initialize frontend: Dialog' ARE NOT DISPLAYED
RUN apt-get update && apt-get install -y \
#
# System packages
iproute2 \
procps \
lsb-release \
sudo \
unattended-upgrades \
dnsutils \
iputils-ping \
xauth \
openssl \
tar \
zip \
#
# Helpers
&& apt-get install -y \
ca-certificates \
curl \
wget \
lsof \
gconf2 \
gconf-service \
#
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
# Install LTE stack dependencies --> HERE THE WARNINGS 'debconf: unable to initialize frontend: Dialog' ARE DISPLAYED
RUN chmod +x install_dependencies.sh \
&& export DEBIAN_FRONTEND=noninteractive; ./install_dependencies.sh
install_dependencies.sh:
#!/bin/sh
export DEBIAN_FRONTEND=noninteractive
APT_PACKAGES="lib32z1 \
python-setuptools \
libmysqlclient-dev \
ninja-build"
install_apt_packages() {
sudo apt-get install -y tzdata \
build-essential \
git
for package in $APT_PACKAGES;
do
sudo apt-get -y install "$package";
done
}
main() {
sudo apt-get update && sudo apt-get upgrade -y
install_apt_packages
}
main
EDIT: Thanks to #arkadiusz-drabczyk for telling me to remove sudo from the apt-get commands, it makes perfect sense what he says, that the environment variables drop before executing the command.
Drop sudo in your script, there is point to use it if you're running as root. This is also the reason that DEBIAN_FRONTEND has no effect - sudo drops your current user's environment for security reasons, you'd have to use with -E option to make it work.

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

Can't connect to SQL Server from elixir/phoenix in Docker

I'm trying to connect a "Phoenix (Elixir)-Application" (packed as Docker-Container) to microsoft/mssql-server-linux:latest Docker-Container
Therefore I'm using https://hex.pm/packages/mssql_ecto as Adapter
use Mix.Config
config :my_api, MyApi.Repo,
adapter: MssqlEcto,
database: "dev",
username: "sa",
password: "my_api_password",
hostname: "127.0.0.1",
#odbc_driver: "{SQL Server Native Client 11.0}",
#odbc_driver: "{ODBC Driver 11 for SQL Server}",
#odbc_driver: "{ODBC Driver 13.1 for SQL Server}",
#odbc_driver: "{ODBC Driver 13 for SQL Server}", # <- Default
#port: "1433" # <- Default
My current Dockerfile for running the phoenix-Application in Docker:
FROM elixir:1.5.2
# install ODBC driver
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y curl apt-transport-https debconf-utils apt-utils
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update -y && ACCEPT_EULA=Y apt-get install -y msodbcsql && ACCEPT_EULA=Y apt-get install -y mssql-tools && apt-get install -y unixodbc-dev
RUN apt-get install -y erlang-odbc
I guess the problem is located in my Dockerfile, especially the lines for installing the ODBC driver. When you look at my Mix.Config, you see that i tried many combinations of "odbc-driver"-strings - not one of them works..
heres the output of the phoenix start:
** (Mix) The database for MyApi.Repo couldn't be created: %Mssqlex.Error{constraint_violations: [], message: "[unixODBC][Driver Manager]Can't open lib '/opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2270.0' : file not found Connection to database failed. | ODBC_CODE 01000 | SQL_SERVER_CODE 0", odbc_code: "01000"}
Is anybody out there whos got a working Elixir (docker-image) with the possibility to connect to "microsoft/mssql-server-linux:latest Docker-Container"?
Im very thankful for any help!
BTW ... im able to connect to the "mssql-server-linux Container" from Host via HeidiSQL and
Microsoft SQL Server Management Studio 17 => so no problems with "mssql-server-linux Container" at all.
Setup:
HOST OS: Windows 10 Pro
Docker for Windows: 17.12.0-ce-win47
For all struggling with this: here are the relevant lines of my working Dockerfile for Ubuntu 16:
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install apt-utils apt-transport-https wget
RUN echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/mssql-ubuntu-xenial-release/ xenial main" > /etc/apt/sources.list.d/mssqlpreview.list
RUN apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
RUN apt-get -y update
RUN env ACCEPT_EULA=Y DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
cpanminus \
msodbcsql \
unixodbc-dev-utf16
RUN apt-get install unixodbc-dev-utf16
RUN cd /root && \
wget https://cpan.metacpan.org/authors/id/M/MJ/MJEVANS/DBD-ODBC-1.56.tar.gz && \
tar xf DBD-ODBC-1.56.tar.gz && \
cd /root/DBD-ODBC-1.56 && \
perl Makefile.PL -u && \
cpanm --installdeps . && \
make && \
make test && \
make install && \
rm -rf /root/DBD-ODBC-1.56.tar.gz /root/DBD-ODBC-1.56
# Set locale
RUN apt-get install -y locales
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
The last lines are important for the ODBC-Driver to work properly.
odbc_driver: "{ODBC Driver 13 for SQL Server}
for a working MssqlEcto-Configuration!
#Nolan: i was very happy when i get it working with Ubuntu, i switched instantly to Debian (elixir 1.6) - it works. but u have to change some parts. Heres my working Dockerfile for elixir.1.6 (debian) - let me if it works with 1.6.1
BTW: the odbc driver is very bitchy when is comes to wrong locale configuration ;)
FROM elixir:1.6
ENV REFRESHED_AT 29-01-2018
# install odbc driver
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install apt-utils apt-transport-https wget
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update
RUN env ACCEPT_EULA=Y DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
cpanminus \
msodbcsql \
unixodbc-dev
RUN apt-get install unixodbc-dev
RUN ACCEPT_EULA=Y apt-get install -y msodbcsql
RUN ACCEPT_EULA=Y apt-get install -y mssql-tools
RUN cd /root && \
wget https://cpan.metacpan.org/authors/id/M/MJ/MJEVANS/DBD-ODBC-1.56.tar.gz && \
tar xf DBD-ODBC-1.56.tar.gz && \
cd /root/DBD-ODBC-1.56 && \
perl Makefile.PL -u && \
cpanm --installdeps . && \
make && \
make test && \
make install && \
rm -rf /root/DBD-ODBC-1.56.tar.gz /root/DBD-ODBC-1.56
# set locale configuration
RUN apt-get install -y locales
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
# install hex
RUN mix local.hex --force
# install rebar
RUN mix local.rebar --force
# install phoenix
RUN mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez --force
# install node
RUN curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh
RUN bash nodesource_setup.sh
RUN apt-get install nodejs
IDK if this is production ready (in sense of security and optimizing) - when u get an optimized version please let me know! cheers

Resources