Revert "Revert "First pass in moving to debian""
authorRafael dos Santos Silva <xfalcox@gmail.com>
Mon, 19 Aug 2019 18:17:01 +0000 (15:17 -0300)
committerRafael dos Santos Silva <xfalcox@gmail.com>
Mon, 19 Aug 2019 18:17:01 +0000 (15:17 -0300)
This reverts commit 29204e415846c121554d41c34f241f2291e7a587.

image/base/Dockerfile
image/base/install-imagemagick
image/base/install-nginx
image/discourse_dev/Dockerfile
image/discourse_fast_switch/Dockerfile
image/discourse_test/Dockerfile

index 83e34a9a2d7e706164b922ac0963117f4a347a5d..bd771a1037d271af34b153cc580ddc86e41d4295 100644 (file)
@@ -1,6 +1,6 @@
 # NAME:     discourse/base
 # VERSION:  release
-FROM ubuntu:16.04
+FROM debian:buster-slim
 
 ENV PG_MAJOR 10
 ENV RUBY_ALLOCATOR /usr/lib/libjemalloc.so.1
@@ -10,49 +10,52 @@ ENV RAILS_ENV production
 
 RUN echo 2.0.`date +%Y%m%d` > /VERSION
 
-RUN apt-get update && apt-get install -y lsb-release sudo curl
+RUN apt update && apt install -y gnupg sudo curl
 RUN echo "debconf debconf/frontend select Teletype" | debconf-set-selections
-RUN echo "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main restricted universe" > /etc/apt/sources.list
-RUN echo "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc)-updates main restricted universe" >> /etc/apt/sources.list
-RUN echo "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc)-security main restricted universe" >> /etc/apt/sources.list
-RUN apt-get update && apt-get -y install fping
-RUN sh -c "fping proxy && echo 'Acquire { Retries \"0\"; HTTP { Proxy \"http://proxy:3128\";}; };' > /etc/apt/apt.conf.d/40proxy && apt-get update || true"
-RUN apt-get -y install software-properties-common
+RUN apt update && apt -y install fping
+RUN sh -c "fping proxy && echo 'Acquire { Retries \"0\"; HTTP { Proxy \"http://proxy:3128\";}; };' > /etc/apt/apt.conf.d/40proxy && apt update || true"
+RUN apt -y install software-properties-common
 RUN apt-mark hold initscripts
-RUN apt-get -y upgrade
+RUN apt -y upgrade
+
+RUN apt install -y locales locales-all
+ENV LC_ALL en_US.UTF-8
+ENV LANG en_US.UTF-8
+ENV LANGUAGE en_US.UTF-8
+
 RUN curl https://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | apt-key add -
-RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -sc)-pgdg main" | \
+RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" | \
         tee /etc/apt/sources.list.d/postgres.list
 RUN curl --silent --location https://deb.nodesource.com/setup_10.x | sudo bash -
-RUN apt-get -y update
-RUN apt-get -y install build-essential git wget \
+RUN apt -y update
+RUN apt -y install build-essential git wget \
                        libxslt-dev libcurl4-openssl-dev \
                        libssl-dev libyaml-dev libtool \
                        libxml2-dev gawk parallel \
                        postgresql-${PG_MAJOR} postgresql-client-${PG_MAJOR} \
                        postgresql-contrib-${PG_MAJOR} libpq-dev libreadline-dev \
-                       language-pack-en cron anacron \
+                       cron anacron \
                        psmisc rsyslog vim whois brotli libunwind-dev \
                        libtcmalloc-minimal4
 RUN sed -i -e 's/start -q anacron/anacron -s/' /etc/cron.d/anacron
 RUN sed -i.bak 's/$ModLoad imklog/#$ModLoad imklog/' /etc/rsyslog.conf
 RUN dpkg-divert --local --rename --add /sbin/initctl
 RUN sh -c "test -f /sbin/initctl || ln -s /bin/true /sbin/initctl"
-RUN apt-get -y install haproxy openssh-server
+RUN apt -y install openssh-server
 RUN cd / &&\
-    apt-get -y install runit monit socat &&\
+    apt -y install runit socat &&\
     mkdir -p /etc/runit/1.d &&\
-    apt-get clean &&\
+    apt clean &&\
     rm -f /etc/apt/apt.conf.d/40proxy &&\
     locale-gen en_US &&\
-    apt-get install -y nodejs &&\
+    apt install -y nodejs &&\
     npm install -g uglify-js@"<3" &&\
     npm install -g svgo
 
 ADD install-nginx /tmp/install-nginx
 RUN /tmp/install-nginx
 
-RUN apt-get -y install advancecomp jhead jpegoptim libjpeg-turbo-progs optipng
+RUN apt -y install advancecomp jhead jpegoptim libjpeg-turbo-progs optipng
 
 RUN mkdir /jemalloc-stable && cd /jemalloc-stable &&\
       wget https://github.com/jemalloc/jemalloc/releases/download/3.6.0/jemalloc-3.6.0.tar.bz2 &&\
index 2d93b349b0a587a0ed3fb5ebc5eb7abb0a712ae6..994d4755ea9bfb6aabe3444209b936fa350d7aef 100755 (executable)
@@ -8,8 +8,8 @@ PREFIX=/usr/local
 WDIR=/tmp/imagemagick
 
 # Install build deps
-apt-get -y -q remove imagemagick
-apt-get -y -q install ghostscript gsfonts pkg-config autoconf libbz2-dev libjpeg-dev libtiff-dev libfreetype6-dev
+apt -y -q remove imagemagick
+apt -y -q install ghostscript gsfonts pkg-config autoconf libbz2-dev libjpeg-dev libtiff-dev libfreetype6-dev
 
 
 mkdir -p $WDIR
index 4c35141eef6c14a28e013939aa9a183b0c37ac44..30a4ec0113495448f5b8890bfc08734fa7723961 100755 (executable)
@@ -3,7 +3,7 @@ set -e
 VERSION=1.17.3
 cd /tmp
 
-apt-get install -y autoconf
+apt install -y autoconf
 
 
 git clone https://github.com/bagder/libbrotli
@@ -23,7 +23,7 @@ tar zxf nginx-$VERSION.tar.gz
 cd nginx-$VERSION
 
 # so we get nginx user and so on
-apt-get install -y nginx libpcre3 libpcre3-dev
+apt install -y nginx libpcre3 libpcre3-dev zlib1g zlib1g-dev
 # we don't want to accidentally upgrade nginx and undo our work
 apt-mark hold nginx
 
index bde2245575574ea0b45f88e6353816366d57fba2..b215ed64d11136cb4e88e5df7ac0ef83fe452a95 100644 (file)
@@ -6,7 +6,7 @@ ENV RAILS_ENV development
 #LABEL maintainer="Sam Saffron \"https://twitter.com/samsaffron\""
 
 # Install for mailcatcher gem
-RUN apt-get update && apt-get install -y libsqlite3-dev \
+RUN apt update && apt install -y libsqlite3-dev \
     && gem install mailcatcher && rm -rf /var/lib/apt/lists/*
 
 # Remove the code added on base image
@@ -43,6 +43,6 @@ RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo ap
     echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list &&\
     curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - &&\
     echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list &&\
-    apt-get update &&\
-    apt-get install -y google-chrome-stable yarn nodejs &&\
+    apt update &&\
+    apt install -y google-chrome-stable yarn nodejs &&\
     npm install -g eslint babel-eslint
index 12c7a989dab6495001f81536337e11675aa8d9f9..d900cd56e5c2889eb35628a0f35a614df51d57b0 100644 (file)
@@ -6,7 +6,7 @@ FROM discourse/base:2.0.20180608
 
 #LABEL maintainer="Sam Saffron \"https://twitter.com/samsaffron\""
 
-RUN apt-get -y install ruby bison autoconf &&\
+RUN apt -y install ruby bison autoconf &&\
     cd /src && git clone https://github.com/sstephenson/ruby-build.git &&\
     /src/ruby-build/install.sh &&\
     sudo ruby-build 2.4.4 /usr/ruby_24 &&\
@@ -14,7 +14,7 @@ RUN apt-get -y install ruby bison autoconf &&\
     cp -R /usr/ruby_24/lib/* /usr/local/lib/ &&\
     cp -R /usr/ruby_24/share/* /usr/local/share/ &&\
     cp -R /usr/ruby_24/include/* /usr/local/include/ &&\
-    apt-get -y remove ruby
+    apt -y remove ruby
 
 RUN cd / && ruby-build 2.5.1 /usr/ruby_25
 
index f0fb6dbabfccc899b943bdb08a28d20f54191e0d..a3fe073fbbdff54fbf38d75074e36d52a66b4168 100644 (file)
@@ -21,8 +21,8 @@ RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo ap
     echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list &&\
     curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - &&\
     echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list &&\
-    apt-get update &&\
-    apt-get install -y libgconf-2-4 google-chrome-stable yarn nodejs &&\
+    apt update &&\
+    apt install -y libgconf-2-4 google-chrome-stable yarn nodejs &&\
     npm install -g eslint babel-eslint &&\
     cd /var/www/discourse && sudo -E -u discourse -H yarn install