From 1b0aacb2b416c247c0ea10a0c9b26541f50ec8e4 Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 15 Sep 2021 15:34:13 +0200 Subject: [PATCH 1/6] fix container name typo --- transport-site/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transport-site/Dockerfile b/transport-site/Dockerfile index 93d4dfd..d26e69a 100644 --- a/transport-site/Dockerfile +++ b/transport-site/Dockerfile @@ -10,7 +10,7 @@ # - https://github.com/elixir-lang/elixir/releases # - https://github.com/erlang/otp/releases # -FROM hexpm/elixir:1.12.2-erlang-24.0.3-focal-20210325 +FROM hexpm/elixir:1.12.2-erlang-24.0.3-ubuntu-focal-20210325 # TODO: iconv could probably be removed later # https://github.com/etalab/transport-site/issues/1591 From e2cb9a111a026977ff75fc668305e39dc0064bac Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 16 Sep 2021 11:46:03 +0200 Subject: [PATCH 2/6] adapt dockerfile to ubuntu --- transport-site/Dockerfile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/transport-site/Dockerfile b/transport-site/Dockerfile index d26e69a..fa8290f 100644 --- a/transport-site/Dockerfile +++ b/transport-site/Dockerfile @@ -12,13 +12,20 @@ # FROM hexpm/elixir:1.12.2-erlang-24.0.3-ubuntu-focal-20210325 -# TODO: iconv could probably be removed later -# https://github.com/etalab/transport-site/issues/1591 -RUN apk add curl bash build-base wget libtool git gnu-libiconv +ARG DEBIAN_FRONTEND=noninteractive +ENV TZ=Europe/Paris +RUN apt-get install -y tzdata + +RUN apt-get update && apt-get install -y \ + curl \ + wget \ + libtool \ + git # To be removed in favor of multistage build with deterministic version numbers, # e.g. https://dev.to/quatermain/comment/njf7 -RUN apk add nodejs-npm yarn +RUN apt-get install -y nodejs npm +RUN npm install -g yarn # Install app dependencies RUN mix local.hex --force From 42e0e3ee01d20df790d123bd6d2ca76fe1f7bb11 Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 20 Sep 2021 16:30:57 +0200 Subject: [PATCH 3/6] install node and npm with nvm to control version --- transport-site/Dockerfile | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/transport-site/Dockerfile b/transport-site/Dockerfile index fa8290f..10bf2b2 100644 --- a/transport-site/Dockerfile +++ b/transport-site/Dockerfile @@ -22,9 +22,25 @@ RUN apt-get update && apt-get install -y \ libtool \ git -# To be removed in favor of multistage build with deterministic version numbers, -# e.g. https://dev.to/quatermain/comment/njf7 -RUN apt-get install -y nodejs npm +ENV NVM_VERSION v0.29.0 +ENV NODE_VERSION 14.16.1 +ENV NVM_DIR $HOME/.nvm + +# Replace shell with bash so we can source files +RUN rm /bin/sh && ln -s /bin/bash /bin/sh + +# Install NVM +RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/${NVM_VERSION}/install.sh | bash + +# Install NODE +RUN source $NVM_DIR/nvm.sh; \ + nvm install $NODE_VERSION; \ + nvm use --delete-prefix $NODE_VERSION; + +# add to path +ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules +ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH + RUN npm install -g yarn # Install app dependencies From 89e48c36fd65b254f94a80d6e98b149c5baf0515 Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 21 Sep 2021 14:56:05 +0200 Subject: [PATCH 4/6] update OTP to 24.0.4 (from 24.0.3) --- transport-site/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transport-site/Dockerfile b/transport-site/Dockerfile index 10bf2b2..c95adb8 100644 --- a/transport-site/Dockerfile +++ b/transport-site/Dockerfile @@ -10,7 +10,7 @@ # - https://github.com/elixir-lang/elixir/releases # - https://github.com/erlang/otp/releases # -FROM hexpm/elixir:1.12.2-erlang-24.0.3-ubuntu-focal-20210325 +FROM hexpm/elixir:1.12.2-erlang-24.0.4-ubuntu-focal-20210325 ARG DEBIAN_FRONTEND=noninteractive ENV TZ=Europe/Paris From 7cc7f5e0158f8ee0109b969241f240af080ebce0 Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 21 Sep 2021 14:56:34 +0200 Subject: [PATCH 5/6] no need to erase sh, it as a source command too --- transport-site/Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/transport-site/Dockerfile b/transport-site/Dockerfile index c95adb8..3e6d3cb 100644 --- a/transport-site/Dockerfile +++ b/transport-site/Dockerfile @@ -26,14 +26,11 @@ ENV NVM_VERSION v0.29.0 ENV NODE_VERSION 14.16.1 ENV NVM_DIR $HOME/.nvm -# Replace shell with bash so we can source files -RUN rm /bin/sh && ln -s /bin/bash /bin/sh - # Install NVM RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/${NVM_VERSION}/install.sh | bash -# Install NODE -RUN source $NVM_DIR/nvm.sh; \ +# Install NODE ("." is the sh equivalent to the bash "source" command) +RUN . $NVM_DIR/nvm.sh; \ nvm install $NODE_VERSION; \ nvm use --delete-prefix $NODE_VERSION; From 8906eaf6534f320c87a5baf555e07e03ea0fbe5e Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 22 Sep 2021 11:04:10 +0200 Subject: [PATCH 6/6] replace ; by && to avoid silent errors --- transport-site/Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/transport-site/Dockerfile b/transport-site/Dockerfile index 3e6d3cb..f3592e8 100644 --- a/transport-site/Dockerfile +++ b/transport-site/Dockerfile @@ -30,9 +30,7 @@ ENV NVM_DIR $HOME/.nvm RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/${NVM_VERSION}/install.sh | bash # Install NODE ("." is the sh equivalent to the bash "source" command) -RUN . $NVM_DIR/nvm.sh; \ - nvm install $NODE_VERSION; \ - nvm use --delete-prefix $NODE_VERSION; +RUN . $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && nvm use --delete-prefix $NODE_VERSION # add to path ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules