From 0fa1d44977ea735686cf90f16826b8db17267458 Mon Sep 17 00:00:00 2001 From: Patrick Lee <31744877+patricklee2@users.noreply.github.com> Date: Tue, 27 Nov 2018 12:58:30 -0800 Subject: [PATCH 01/11] 2.3.8 --- {2.3.3 => 2.3.8}/Dockerfile | 4 +- {2.3.3 => 2.3.8}/README.txt | 0 {2.3.3 => 2.3.8}/hostingstart.html | 74 ++++++++++++------------- {2.3.3 => 2.3.8}/init_container.sh | 0 {2.3.3 => 2.3.8}/sshd_config | 0 {2.3.3 => 2.3.8}/startup.sh | 1 + {2.3.3 => 2.3.8}/staticsite.rb | 0 base_images/{2.3.3 => 2.3.8}/Dockerfile | 4 +- build.sh | 6 +- 9 files changed, 45 insertions(+), 44 deletions(-) rename {2.3.3 => 2.3.8}/Dockerfile (95%) rename {2.3.3 => 2.3.8}/README.txt (100%) rename {2.3.3 => 2.3.8}/hostingstart.html (99%) rename {2.3.3 => 2.3.8}/init_container.sh (100%) rename {2.3.3 => 2.3.8}/sshd_config (100%) rename {2.3.3 => 2.3.8}/startup.sh (99%) rename {2.3.3 => 2.3.8}/staticsite.rb (100%) rename base_images/{2.3.3 => 2.3.8}/Dockerfile (95%) diff --git a/2.3.3/Dockerfile b/2.3.8/Dockerfile similarity index 95% rename from 2.3.3/Dockerfile rename to 2.3.8/Dockerfile index deb08df..8471879 100644 --- a/2.3.3/Dockerfile +++ b/2.3.8/Dockerfile @@ -1,4 +1,4 @@ -FROM appsvc/rubybase:2.3.3 +FROM appsvc/rubybase:2.3.8 MAINTAINER Azure App Services Container Images COPY init_container.sh /bin/ @@ -13,7 +13,7 @@ RUN apt-get update -qq \ && echo "cd /home" >> /etc/bash.bashrc RUN eval "$(rbenv init -)" \ - && rbenv global 2.3.3 + && rbenv global 2.3.8 RUN chmod 755 /bin/init_container.sh \ && mkdir -p /home/LogFiles/ \ diff --git a/2.3.3/README.txt b/2.3.8/README.txt similarity index 100% rename from 2.3.3/README.txt rename to 2.3.8/README.txt diff --git a/2.3.3/hostingstart.html b/2.3.8/hostingstart.html similarity index 99% rename from 2.3.3/hostingstart.html rename to 2.3.8/hostingstart.html index 21d974c..580cc12 100644 --- a/2.3.3/hostingstart.html +++ b/2.3.8/hostingstart.html @@ -1,38 +1,38 @@ - - - - - - - -Codestin Search App - - - - - - -
-
-Codestin Search App -
-
-

Your App Service app has been created

-

Go to your app's - -Quick Start guide in the Azure portal to get started or read our - -deployment documentation. -

-
-
- - - + + + + + + + +Codestin Search App + + + + + + +
+
+Codestin Search App +
+
+

Your App Service app has been created

+

Go to your app's + +Quick Start guide in the Azure portal to get started or read our + +deployment documentation. +

+
+
+ + + \ No newline at end of file diff --git a/2.3.3/init_container.sh b/2.3.8/init_container.sh similarity index 100% rename from 2.3.3/init_container.sh rename to 2.3.8/init_container.sh diff --git a/2.3.3/sshd_config b/2.3.8/sshd_config similarity index 100% rename from 2.3.3/sshd_config rename to 2.3.8/sshd_config diff --git a/2.3.3/startup.sh b/2.3.8/startup.sh similarity index 99% rename from 2.3.3/startup.sh rename to 2.3.8/startup.sh index 14d520a..770d893 100644 --- a/2.3.3/startup.sh +++ b/2.3.8/startup.sh @@ -76,6 +76,7 @@ if [ "$ZIPPED_GEMS" -eq 1 ] fi else bundle config --local path "vendor/bundle" + bundle update if bundle check --path "vendor/bundle" | grep satisfied then echo 'dependency check passed' diff --git a/2.3.3/staticsite.rb b/2.3.8/staticsite.rb similarity index 100% rename from 2.3.3/staticsite.rb rename to 2.3.8/staticsite.rb diff --git a/base_images/2.3.3/Dockerfile b/base_images/2.3.8/Dockerfile similarity index 95% rename from base_images/2.3.3/Dockerfile rename to base_images/2.3.8/Dockerfile index 13eb25f..a125449 100644 --- a/base_images/2.3.3/Dockerfile +++ b/base_images/2.3.8/Dockerfile @@ -22,13 +22,13 @@ RUN chmod -R 777 /usr/local/.rbenv/plugins/ruby-build RUN /usr/local/.rbenv/plugins/ruby-build/install.sh -# Install ruby 2.3.3 +# Install ruby 2.3.8 ENV RUBY_CONFIGURE_OPTS=--disable-install-doc ENV RUBY_CFLAGS=-O3 RUN eval "$(rbenv init -)" \ - && export WEBSITES_LATEST_NODE_VERSION="2.3.3" \ + && export WEBSITES_LATEST_NODE_VERSION="2.3.8" \ && rbenv install $WEBSITES_LATEST_NODE_VERSION \ && rbenv rehash \ && rbenv global $WEBSITES_LATEST_NODE_VERSION \ diff --git a/build.sh b/build.sh index cbebc78..256d783 100755 --- a/build.sh +++ b/build.sh @@ -3,14 +3,14 @@ set -x -e buildnumber=${4-$(date -u +"%y%m%d%H%M")} -#docker build -t "$1"/rubybase:2.3.3_"$buildnumber" base_images/2.3.3 -docker build --no-cache -t "$1"/ruby:2.3.3_"$buildnumber" -t "$1"/ruby:latest_"$buildnumber" 2.3.3 +docker build -t "$1"/rubybase:2.3.8_"$buildnumber" base_images/2.3.8 +docker build --no-cache -t "$1"/ruby:2.3.8_"$buildnumber" -t "$1"/ruby:latest_"$buildnumber" 2.3.8 docker tag "$1"/ruby:latest_"$buildnumber" "$1"/ruby:latest docker login -u "$2" -p "$3" docker push "$1"/ruby:latest_"$buildnumber" -docker push "$1"/ruby:2.3.3_"$buildnumber" +docker push "$1"/ruby:2.3.8_"$buildnumber" docker push "$1"/ruby:latest docker logout From 528fbecd064dfcd55b604e96802019235422e24d Mon Sep 17 00:00:00 2001 From: Patrick Lee <31744877+patricklee2@users.noreply.github.com> Date: Fri, 30 Nov 2018 15:32:09 -0800 Subject: [PATCH 02/11] 2.4.5 --- 2.3.8/Dockerfile | 2 +- 2.3.8/init_container.sh | 2 +- 2.4.5/Dockerfile | 36 ++++++++++++ 2.4.5/README.txt | 1 + 2.4.5/hostingstart.html | 38 ++++++++++++ 2.4.5/init_container.sh | 25 ++++++++ 2.4.5/sshd_config | 15 +++++ 2.4.5/startup.sh | 111 +++++++++++++++++++++++++++++++++++ 2.4.5/staticsite.rb | 7 +++ base_images/2.3.8/Dockerfile | 1 + base_images/2.4.5/Dockerfile | 53 +++++++++++++++++ 11 files changed, 289 insertions(+), 2 deletions(-) create mode 100644 2.4.5/Dockerfile create mode 100644 2.4.5/README.txt create mode 100644 2.4.5/hostingstart.html create mode 100644 2.4.5/init_container.sh create mode 100644 2.4.5/sshd_config create mode 100644 2.4.5/startup.sh create mode 100644 2.4.5/staticsite.rb create mode 100644 base_images/2.4.5/Dockerfile diff --git a/2.3.8/Dockerfile b/2.3.8/Dockerfile index 8471879..e70133c 100644 --- a/2.3.8/Dockerfile +++ b/2.3.8/Dockerfile @@ -1,5 +1,5 @@ FROM appsvc/rubybase:2.3.8 -MAINTAINER Azure App Services Container Images +LABEL maintainer="Azure App Services Container Images " COPY init_container.sh /bin/ COPY startup.sh /opt/ diff --git a/2.3.8/init_container.sh b/2.3.8/init_container.sh index cb32295..af34525 100644 --- a/2.3.8/init_container.sh +++ b/2.3.8/init_container.sh @@ -20,6 +20,6 @@ service ssh start eval $(printenv | awk -F= '{print "export " $1"="$2 }' >> /etc/profile) eval "$(rbenv init -)" -rbenv global 2.3.3 +rbenv global 2.3.8 /opt/startup.sh "$@" diff --git a/2.4.5/Dockerfile b/2.4.5/Dockerfile new file mode 100644 index 0000000..7d674df --- /dev/null +++ b/2.4.5/Dockerfile @@ -0,0 +1,36 @@ +FROM appsvc/rubybase:2.4.5 +LABEL maintainer="Azure App Services Container Images " + +COPY init_container.sh /bin/ +COPY startup.sh /opt/ +COPY sshd_config /etc/ssh/ +COPY hostingstart.html /home/site/wwwroot/hostingstart.html +COPY staticsite.rb /opt/staticsite.rb + +RUN apt-get update -qq \ + && apt-get install -y nodejs openssh-server vim curl wget tcptraceroute --no-install-recommends \ + && echo "root:Docker!" | chpasswd \ + && echo "cd /home" >> /etc/bash.bashrc + +RUN eval "$(rbenv init -)" \ + && rbenv global 2.4.5 + +RUN chmod 755 /bin/init_container.sh \ + && mkdir -p /home/LogFiles/ \ + && chmod 755 /opt/startup.sh + +EXPOSE 2222 8080 + +ENV PORT 8080 +ENV WEBSITE_ROLE_INSTANCE_ID localRoleInstance +ENV WEBSITE_INSTANCE_ID localInstance +ENV PATH ${PATH}:/home/site/wwwroot + +# install libssl1.0.2 +RUN wget http://ftp.us.debian.org/debian/pool/main/o/openssl1.0/libssl1.0.2_1.0.2l-2+deb9u3_amd64.deb \ + && apt-get install dialog \ + && dpkg -i libssl1.0.2_1.0.2l-2+deb9u3_amd64.deb + +WORKDIR /home/site/wwwroot + +ENTRYPOINT [ "/bin/init_container.sh" ] diff --git a/2.4.5/README.txt b/2.4.5/README.txt new file mode 100644 index 0000000..5c6c91f --- /dev/null +++ b/2.4.5/README.txt @@ -0,0 +1 @@ +This image is in development, not yet a working state. Use 2.3-1 for personal testing. diff --git a/2.4.5/hostingstart.html b/2.4.5/hostingstart.html new file mode 100644 index 0000000..580cc12 --- /dev/null +++ b/2.4.5/hostingstart.html @@ -0,0 +1,38 @@ + + + + + + + +Codestin Search App + + + + + + +
+
+Codestin Search App +
+
+

Your App Service app has been created

+

Go to your app's + +Quick Start guide in the Azure portal to get started or read our + +deployment documentation. +

+
+
+ + + + \ No newline at end of file diff --git a/2.4.5/init_container.sh b/2.4.5/init_container.sh new file mode 100644 index 0000000..b0b45be --- /dev/null +++ b/2.4.5/init_container.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +cat >/etc/motd < + \/ \/ \/ +A P P S E R V I C E O N L I N U X + +Documentation: http://aka.ms/webapp-linux +Ruby quickstart: https://aka.ms/ruby-qs + +EOL +cat /etc/motd + +service ssh start + +# Get environment variables to show up in SSH session +eval $(printenv | awk -F= '{print "export " $1"="$2 }' >> /etc/profile) + +eval "$(rbenv init -)" +rbenv global 2.4.5 +/opt/startup.sh "$@" + diff --git a/2.4.5/sshd_config b/2.4.5/sshd_config new file mode 100644 index 0000000..a3690f2 --- /dev/null +++ b/2.4.5/sshd_config @@ -0,0 +1,15 @@ +# This is ssh server systemwide configuration file. +# +# /etc/sshd_config + +Port 2222 +ListenAddress 0.0.0.0 +LoginGraceTime 180 +X11Forwarding yes +Ciphers aes128-cbc,3des-cbc,aes256-cbc +MACs hmac-sha1,hmac-sha1-96 +StrictModes yes +SyslogFacility DAEMON +PasswordAuthentication yes +PermitEmptyPasswords no +PermitRootLogin yes diff --git a/2.4.5/startup.sh b/2.4.5/startup.sh new file mode 100644 index 0000000..770d893 --- /dev/null +++ b/2.4.5/startup.sh @@ -0,0 +1,111 @@ +#!/usr/bin/env bash + +if ! [ -e /home/site/wwwroot/Gemfile ] && [ -z "$RAILS_IGNORE_SPLASH" ] + then + echo 'No Gemfile found and RAILS_IGNORE_SPLASH not set, running default static site' + exec ruby /opt/staticsite.rb +fi + +if [ -z "$BUNDLE_WITHOUT" ]; then + echo "Bundle install with no 'without' options"; + RUBY_OPTIONS=""; +else + RUBY_OPTIONS="--without $BUNDLE_WITHOUT"; + echo "Bundle install with options $RUBY_OPTIONS"; +fi + +if [ -z "$BUNDLE_INSTALL_LOCATION" ]; then + echo "Defaulting gem installation directory to /tmp/bundle"; + BUNDLE_INSTALL_LOCATION="/tmp/bundle"; +else + echo "Gem installation directory is $BUNDLE_INSTALL_LOCATION"; +fi + +if [ -z "$RUBY_SITE_CONFIG_DIR" ]; then + echo "Defaulting site config directory to /home/site/config"; + RUBY_SITE_CONFIG_DIR="/home/site/config" +else + echo "site config directory is $RUBY_SITE_CONFIG_DIR"; +fi + +if [ -n "$SECRET_KEY_BASE" ] + then + echo 'Secret key base present' + else + echo 'Generating a secret key base' + export SECRET_KEY_BASE=$(ruby -rsecurerandom -e 'puts SecureRandom.hex(64)') +fi + +if [ -n "$RAILS_ENV" ] + then + echo "RAILS_ENV set to $RAILS_ENV" + else + echo 'RAILS_ENV not set, default to production' + export RAILS_ENV='production' +fi + +echo 'Removing any leftover pids if present' +rm -f tmp/pids/* ; + +# Support zipped gems +export ZIPPED_GEMS=0 +if [ -f "${RUBY_SITE_CONFIG_DIR}/gems.tgz" ] + then + echo "gems.tgz detected, beginning unzipping process" + echo "unzipping..." + mkdir -p $BUNDLE_INSTALL_LOCATION + cp ${RUBY_SITE_CONFIG_DIR}/gems.tgz /tmp + tar -C $BUNDLE_INSTALL_LOCATION -xf /tmp/gems.tgz + + echo 'Removing bundler config' + rm -f ${BUNDLE_INSTALL_LOCATION}/config + + export ZIPPED_GEMS=1 +fi + +echo 'Running bundle check' +if [ "$ZIPPED_GEMS" -eq 1 ] + then + bundle config --global path $BUNDLE_INSTALL_LOCATION + if bundle check | grep satisfied + then + echo 'dependency check passed' + else + echo 'missing dependencies, try redeploying' + exit -1 + fi + else + bundle config --local path "vendor/bundle" + bundle update + if bundle check --path "vendor/bundle" | grep satisfied + then + echo 'dependency check passed' + else + echo 'missing dependencies, try redeploying' + exit -1 + fi +fi + +if [ "$ZIPPED_GEMS" -eq 1 ] + then + echo "running bundle install $RUBY_OPTIONS --no-deployment" + bundle install --no-deployment $RUBY_OPTIONS + else + echo "running bundle install $RUBY_OPTIONS --local --path vendor/bundle" + bundle install $RUBY_OPTIONS --local --path vendor/bundle +fi + +if [ -n "$GEM_PRISTINE" ] + then + echo 'running "gem pristine --all"' + bundle exec gem pristine --all +fi + +if [ $# -ne 0 ] + then + echo "Executing $@" + exec "$@" + else + echo "defaulting to command: \"bundle exec rails server -e $RAILS_ENV -p $PORT\"" + exec bundle exec rails server -b 0.0.0.0 -e "$RAILS_ENV" -p "$PORT" +fi \ No newline at end of file diff --git a/2.4.5/staticsite.rb b/2.4.5/staticsite.rb new file mode 100644 index 0000000..052cbb1 --- /dev/null +++ b/2.4.5/staticsite.rb @@ -0,0 +1,7 @@ +require 'webrick' +options = { + :Port => ENV["PORT"].to_i, + :DirectoryIndex => ["hostingstart.html"], + :DocumentRoot => '.' +} +WEBrick::HTTPServer.new(options).start diff --git a/base_images/2.3.8/Dockerfile b/base_images/2.3.8/Dockerfile index a125449..1803f08 100644 --- a/base_images/2.3.8/Dockerfile +++ b/base_images/2.3.8/Dockerfile @@ -1,4 +1,5 @@ FROM buildpack-deps:jessie-curl +LABEL maintainer="Azure App Services Container Images " RUN apt-get update -qq diff --git a/base_images/2.4.5/Dockerfile b/base_images/2.4.5/Dockerfile new file mode 100644 index 0000000..e3741c1 --- /dev/null +++ b/base_images/2.4.5/Dockerfile @@ -0,0 +1,53 @@ +FROM buildpack-deps:jessie-curl +LABEL maintainer="Azure App Services Container Images " + +RUN apt-get update -qq + +# Dependencies for various ruby and rubygem installations +RUN apt-get install -y git --no-install-recommends +RUN apt-get install -y libreadline-dev bzip2 build-essential libssl-dev zlib1g-dev libpq-dev libsqlite3-dev \ + curl patch gawk g++ gcc make libc6-dev patch libreadline6-dev libyaml-dev sqlite3 autoconf \ + libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev bison libxslt-dev \ + libxml2-dev libmysqlclient-dev --no-install-recommends + +# rbenv +RUN git clone https://github.com/rbenv/rbenv.git /usr/local/.rbenv +RUN chmod -R 777 /usr/local/.rbenv + +ENV RBENV_ROOT="/usr/local/.rbenv" + +ENV PATH="$RBENV_ROOT/bin:/usr/local:$PATH" + +RUN git clone https://github.com/rbenv/ruby-build.git /usr/local/.rbenv/plugins/ruby-build +RUN chmod -R 777 /usr/local/.rbenv/plugins/ruby-build + +RUN /usr/local/.rbenv/plugins/ruby-build/install.sh + +# Install ruby 2.4.5 +ENV RUBY_CONFIGURE_OPTS=--disable-install-doc + +ENV RUBY_CFLAGS=-O3 + +RUN eval "$(rbenv init -)" \ + && export WEBSITES_LATEST_NODE_VERSION="2.4.5" \ + && rbenv install $WEBSITES_LATEST_NODE_VERSION \ + && rbenv rehash \ + && rbenv global $WEBSITES_LATEST_NODE_VERSION \ + && ls /usr/local -a \ + && gem install bundler --version "=1.13.6"\ + && chmod -R 777 /usr/local/.rbenv/versions \ + && chmod -R 777 /usr/local/.rbenv/version + +RUN eval "$(rbenv init -)" \ + && rbenv global $WEBSITES_LATEST_NODE_VERSION \ + && bundle config --global build.nokogiri -- --use-system-libraries + +# Because Nokogiri tries to build libraries on its own otherwise +ENV NOKOGIRI_USE_SYSTEM_LIBRARIES=true + +# SQL Server gem support +RUN apt-get install -y unixodbc-dev freetds-dev freetds-bin + +# Make temp directory for ruby images +RUN mkdir -p /tmp/bundle +RUN chmod 777 /tmp/bundle From 99af481bb9362bd603a0879bc8481335c461b547 Mon Sep 17 00:00:00 2001 From: Patrick Lee <31744877+patricklee2@users.noreply.github.com> Date: Sat, 16 Feb 2019 19:20:31 -0800 Subject: [PATCH 03/11] do not update gems --- 2.3.8/Dockerfile | 4 ++-- 2.3.8/startup.sh | 31 ++++++++++++++++++------------- 2.4.5/Dockerfile | 4 ++-- 2.4.5/startup.sh | 31 ++++++++++++++++++------------- 4 files changed, 40 insertions(+), 30 deletions(-) diff --git a/2.3.8/Dockerfile b/2.3.8/Dockerfile index e70133c..807345e 100644 --- a/2.3.8/Dockerfile +++ b/2.3.8/Dockerfile @@ -27,9 +27,9 @@ ENV WEBSITE_INSTANCE_ID localInstance ENV PATH ${PATH}:/home/site/wwwroot # install libssl1.0.2 -RUN wget http://ftp.us.debian.org/debian/pool/main/o/openssl1.0/libssl1.0.2_1.0.2l-2+deb9u3_amd64.deb \ +RUN wget http://ftp.us.debian.org/debian/pool/main/o/openssl1.0/libssl1.0.2_1.0.2q-1~deb9u1_amd64.deb \ && apt-get install dialog \ - && dpkg -i libssl1.0.2_1.0.2l-2+deb9u3_amd64.deb + && dpkg -i libssl1.0.2_1.0.2q-1~deb9u1_amd64.deb WORKDIR /home/site/wwwroot diff --git a/2.3.8/startup.sh b/2.3.8/startup.sh index 770d893..795b27f 100644 --- a/2.3.8/startup.sh +++ b/2.3.8/startup.sh @@ -63,36 +63,41 @@ if [ -f "${RUBY_SITE_CONFIG_DIR}/gems.tgz" ] export ZIPPED_GEMS=1 fi +export CHECK_PASSED=0 echo 'Running bundle check' if [ "$ZIPPED_GEMS" -eq 1 ] then bundle config --global path $BUNDLE_INSTALL_LOCATION if bundle check | grep satisfied - then - echo 'dependency check passed' - else - echo 'missing dependencies, try redeploying' - exit -1 + then + echo 'dependency check passed' + export CHECK_PASSED=1 + else + echo 'missing dependencies, try redeploying' + echo `bundle check` fi else bundle config --local path "vendor/bundle" - bundle update if bundle check --path "vendor/bundle" | grep satisfied then echo 'dependency check passed' + export CHECK_PASSED=1 else echo 'missing dependencies, try redeploying' - exit -1 + echo `bundle check --path "vendor/bundle"` fi fi -if [ "$ZIPPED_GEMS" -eq 1 ] +if [ "$CHECK_PASSED" -eq 0 ] then - echo "running bundle install $RUBY_OPTIONS --no-deployment" - bundle install --no-deployment $RUBY_OPTIONS - else - echo "running bundle install $RUBY_OPTIONS --local --path vendor/bundle" - bundle install $RUBY_OPTIONS --local --path vendor/bundle + if [ "$ZIPPED_GEMS" -eq 1 ] + then + echo "running bundle install $RUBY_OPTIONS --no-deployment" + bundle install --no-deployment $RUBY_OPTIONS + else + echo "running bundle install $RUBY_OPTIONS --local --path vendor/bundle" + bundle install $RUBY_OPTIONS --local --path vendor/bundle + fi fi if [ -n "$GEM_PRISTINE" ] diff --git a/2.4.5/Dockerfile b/2.4.5/Dockerfile index 7d674df..2ed4ac7 100644 --- a/2.4.5/Dockerfile +++ b/2.4.5/Dockerfile @@ -27,9 +27,9 @@ ENV WEBSITE_INSTANCE_ID localInstance ENV PATH ${PATH}:/home/site/wwwroot # install libssl1.0.2 -RUN wget http://ftp.us.debian.org/debian/pool/main/o/openssl1.0/libssl1.0.2_1.0.2l-2+deb9u3_amd64.deb \ +RUN wget http://ftp.us.debian.org/debian/pool/main/o/openssl1.0/libssl1.0.2_1.0.2q-1~deb9u1_amd64.deb \ && apt-get install dialog \ - && dpkg -i libssl1.0.2_1.0.2l-2+deb9u3_amd64.deb + && dpkg -i libssl1.0.2_1.0.2q-1~deb9u1_amd64.deb WORKDIR /home/site/wwwroot diff --git a/2.4.5/startup.sh b/2.4.5/startup.sh index 770d893..795b27f 100644 --- a/2.4.5/startup.sh +++ b/2.4.5/startup.sh @@ -63,36 +63,41 @@ if [ -f "${RUBY_SITE_CONFIG_DIR}/gems.tgz" ] export ZIPPED_GEMS=1 fi +export CHECK_PASSED=0 echo 'Running bundle check' if [ "$ZIPPED_GEMS" -eq 1 ] then bundle config --global path $BUNDLE_INSTALL_LOCATION if bundle check | grep satisfied - then - echo 'dependency check passed' - else - echo 'missing dependencies, try redeploying' - exit -1 + then + echo 'dependency check passed' + export CHECK_PASSED=1 + else + echo 'missing dependencies, try redeploying' + echo `bundle check` fi else bundle config --local path "vendor/bundle" - bundle update if bundle check --path "vendor/bundle" | grep satisfied then echo 'dependency check passed' + export CHECK_PASSED=1 else echo 'missing dependencies, try redeploying' - exit -1 + echo `bundle check --path "vendor/bundle"` fi fi -if [ "$ZIPPED_GEMS" -eq 1 ] +if [ "$CHECK_PASSED" -eq 0 ] then - echo "running bundle install $RUBY_OPTIONS --no-deployment" - bundle install --no-deployment $RUBY_OPTIONS - else - echo "running bundle install $RUBY_OPTIONS --local --path vendor/bundle" - bundle install $RUBY_OPTIONS --local --path vendor/bundle + if [ "$ZIPPED_GEMS" -eq 1 ] + then + echo "running bundle install $RUBY_OPTIONS --no-deployment" + bundle install --no-deployment $RUBY_OPTIONS + else + echo "running bundle install $RUBY_OPTIONS --local --path vendor/bundle" + bundle install $RUBY_OPTIONS --local --path vendor/bundle + fi fi if [ -n "$GEM_PRISTINE" ] From ac67aa50a6a0e27b1336d0ee61b62692d1c53114 Mon Sep 17 00:00:00 2001 From: Ranjith Ramachandra Date: Wed, 27 Feb 2019 22:31:19 +0000 Subject: [PATCH 04/11] Update ports --- 2.3.8/Dockerfile | 1 + 2.3.8/init_container.sh | 1 + 2.3.8/sshd_config | 2 +- 2.4.5/Dockerfile | 1 + 2.4.5/init_container.sh | 1 + 2.4.5/sshd_config | 2 +- 6 files changed, 6 insertions(+), 2 deletions(-) diff --git a/2.3.8/Dockerfile b/2.3.8/Dockerfile index 807345e..1ba4c9e 100644 --- a/2.3.8/Dockerfile +++ b/2.3.8/Dockerfile @@ -22,6 +22,7 @@ RUN chmod 755 /bin/init_container.sh \ EXPOSE 2222 8080 ENV PORT 8080 +ENV SSH_PORT 2222 ENV WEBSITE_ROLE_INSTANCE_ID localRoleInstance ENV WEBSITE_INSTANCE_ID localInstance ENV PATH ${PATH}:/home/site/wwwroot diff --git a/2.3.8/init_container.sh b/2.3.8/init_container.sh index af34525..065c47a 100644 --- a/2.3.8/init_container.sh +++ b/2.3.8/init_container.sh @@ -14,6 +14,7 @@ Ruby quickstart: https://aka.ms/ruby-qs EOL cat /etc/motd +sed -i "s/{SSH_PORT}/$SSH_PORT/g" /etc/ssh/sshd_config service ssh start # Get environment variables to show up in SSH session diff --git a/2.3.8/sshd_config b/2.3.8/sshd_config index a3690f2..7787ce7 100644 --- a/2.3.8/sshd_config +++ b/2.3.8/sshd_config @@ -2,7 +2,7 @@ # # /etc/sshd_config -Port 2222 +Port SSH_PORT ListenAddress 0.0.0.0 LoginGraceTime 180 X11Forwarding yes diff --git a/2.4.5/Dockerfile b/2.4.5/Dockerfile index 2ed4ac7..fcece2a 100644 --- a/2.4.5/Dockerfile +++ b/2.4.5/Dockerfile @@ -22,6 +22,7 @@ RUN chmod 755 /bin/init_container.sh \ EXPOSE 2222 8080 ENV PORT 8080 +ENV SSH_PORT 2222 ENV WEBSITE_ROLE_INSTANCE_ID localRoleInstance ENV WEBSITE_INSTANCE_ID localInstance ENV PATH ${PATH}:/home/site/wwwroot diff --git a/2.4.5/init_container.sh b/2.4.5/init_container.sh index b0b45be..6402569 100644 --- a/2.4.5/init_container.sh +++ b/2.4.5/init_container.sh @@ -14,6 +14,7 @@ Ruby quickstart: https://aka.ms/ruby-qs EOL cat /etc/motd +sed -i "s/{SSH_PORT}/$SSH_PORT/g" /etc/ssh/sshd_config service ssh start # Get environment variables to show up in SSH session diff --git a/2.4.5/sshd_config b/2.4.5/sshd_config index a3690f2..7787ce7 100644 --- a/2.4.5/sshd_config +++ b/2.4.5/sshd_config @@ -2,7 +2,7 @@ # # /etc/sshd_config -Port 2222 +Port SSH_PORT ListenAddress 0.0.0.0 LoginGraceTime 180 X11Forwarding yes From 3dc62a2f1126b234da432662d95e4047566c7fae Mon Sep 17 00:00:00 2001 From: Patrick Lee <31744877+patricklee2@users.noreply.github.com> Date: Mon, 4 Mar 2019 15:55:37 -0800 Subject: [PATCH 05/11] fix ssh --- 2.3.8/init_container.sh | 2 +- 2.4.5/init_container.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/2.3.8/init_container.sh b/2.3.8/init_container.sh index 065c47a..bd210bb 100644 --- a/2.3.8/init_container.sh +++ b/2.3.8/init_container.sh @@ -14,7 +14,7 @@ Ruby quickstart: https://aka.ms/ruby-qs EOL cat /etc/motd -sed -i "s/{SSH_PORT}/$SSH_PORT/g" /etc/ssh/sshd_config +sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config service ssh start # Get environment variables to show up in SSH session diff --git a/2.4.5/init_container.sh b/2.4.5/init_container.sh index 6402569..008240f 100644 --- a/2.4.5/init_container.sh +++ b/2.4.5/init_container.sh @@ -14,7 +14,7 @@ Ruby quickstart: https://aka.ms/ruby-qs EOL cat /etc/motd -sed -i "s/{SSH_PORT}/$SSH_PORT/g" /etc/ssh/sshd_config +sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config service ssh start # Get environment variables to show up in SSH session From 21386fead00e4282e9b57498b8dc0ba2462a685f Mon Sep 17 00:00:00 2001 From: Patrick Lee <31744877+patricklee2@users.noreply.github.com> Date: Tue, 12 Mar 2019 11:41:25 -0700 Subject: [PATCH 06/11] 2.3.3 --- 2.3.3/Dockerfile | 37 +++++++++++ 2.3.3/README.txt | 1 + 2.3.3/hostingstart.html | 38 ++++++++++++ 2.3.3/init_container.sh | 26 ++++++++ 2.3.3/sshd_config | 15 +++++ 2.3.3/startup.sh | 116 +++++++++++++++++++++++++++++++++++ 2.3.3/staticsite.rb | 7 +++ base_images/2.3.3/Dockerfile | 53 ++++++++++++++++ 8 files changed, 293 insertions(+) create mode 100644 2.3.3/Dockerfile create mode 100644 2.3.3/README.txt create mode 100644 2.3.3/hostingstart.html create mode 100644 2.3.3/init_container.sh create mode 100644 2.3.3/sshd_config create mode 100644 2.3.3/startup.sh create mode 100644 2.3.3/staticsite.rb create mode 100644 base_images/2.3.3/Dockerfile diff --git a/2.3.3/Dockerfile b/2.3.3/Dockerfile new file mode 100644 index 0000000..7e6c991 --- /dev/null +++ b/2.3.3/Dockerfile @@ -0,0 +1,37 @@ +FROM appsvc/rubybase:2.3.3 +LABEL maintainer="Azure App Services Container Images " + +COPY init_container.sh /bin/ +COPY startup.sh /opt/ +COPY sshd_config /etc/ssh/ +COPY hostingstart.html /home/site/wwwroot/hostingstart.html +COPY staticsite.rb /opt/staticsite.rb + +RUN apt-get update -qq \ + && apt-get install -y nodejs openssh-server vim curl wget tcptraceroute --no-install-recommends \ + && echo "root:Docker!" | chpasswd \ + && echo "cd /home" >> /etc/bash.bashrc + +RUN eval "$(rbenv init -)" \ + && rbenv global 2.3.3 + +RUN chmod 755 /bin/init_container.sh \ + && mkdir -p /home/LogFiles/ \ + && chmod 755 /opt/startup.sh + +EXPOSE 2222 8080 + +ENV PORT 8080 +ENV SSH_PORT 2222 +ENV WEBSITE_ROLE_INSTANCE_ID localRoleInstance +ENV WEBSITE_INSTANCE_ID localInstance +ENV PATH ${PATH}:/home/site/wwwroot + +# install libssl1.0.2 +RUN wget http://ftp.us.debian.org/debian/pool/main/o/openssl1.0/libssl1.0.2_1.0.2q-1~deb9u1_amd64.deb \ + && apt-get install dialog \ + && dpkg -i libssl1.0.2_1.0.2q-1~deb9u1_amd64.deb + +WORKDIR /home/site/wwwroot + +ENTRYPOINT [ "/bin/init_container.sh" ] diff --git a/2.3.3/README.txt b/2.3.3/README.txt new file mode 100644 index 0000000..5c6c91f --- /dev/null +++ b/2.3.3/README.txt @@ -0,0 +1 @@ +This image is in development, not yet a working state. Use 2.3-1 for personal testing. diff --git a/2.3.3/hostingstart.html b/2.3.3/hostingstart.html new file mode 100644 index 0000000..580cc12 --- /dev/null +++ b/2.3.3/hostingstart.html @@ -0,0 +1,38 @@ + + + + + + + +Codestin Search App + + + + + + +
+
+Codestin Search App +
+
+

Your App Service app has been created

+

Go to your app's + +Quick Start guide in the Azure portal to get started or read our + +deployment documentation. +

+
+
+ + + + \ No newline at end of file diff --git a/2.3.3/init_container.sh b/2.3.3/init_container.sh new file mode 100644 index 0000000..39847a3 --- /dev/null +++ b/2.3.3/init_container.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +cat >/etc/motd < + \/ \/ \/ +A P P S E R V I C E O N L I N U X + +Documentation: http://aka.ms/webapp-linux +Ruby quickstart: https://aka.ms/ruby-qs + +EOL +cat /etc/motd + +sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config +service ssh start + +# Get environment variables to show up in SSH session +eval $(printenv | awk -F= '{print "export " $1"="$2 }' >> /etc/profile) + +eval "$(rbenv init -)" +rbenv global 2.3.3 +/opt/startup.sh "$@" + diff --git a/2.3.3/sshd_config b/2.3.3/sshd_config new file mode 100644 index 0000000..7787ce7 --- /dev/null +++ b/2.3.3/sshd_config @@ -0,0 +1,15 @@ +# This is ssh server systemwide configuration file. +# +# /etc/sshd_config + +Port SSH_PORT +ListenAddress 0.0.0.0 +LoginGraceTime 180 +X11Forwarding yes +Ciphers aes128-cbc,3des-cbc,aes256-cbc +MACs hmac-sha1,hmac-sha1-96 +StrictModes yes +SyslogFacility DAEMON +PasswordAuthentication yes +PermitEmptyPasswords no +PermitRootLogin yes diff --git a/2.3.3/startup.sh b/2.3.3/startup.sh new file mode 100644 index 0000000..795b27f --- /dev/null +++ b/2.3.3/startup.sh @@ -0,0 +1,116 @@ +#!/usr/bin/env bash + +if ! [ -e /home/site/wwwroot/Gemfile ] && [ -z "$RAILS_IGNORE_SPLASH" ] + then + echo 'No Gemfile found and RAILS_IGNORE_SPLASH not set, running default static site' + exec ruby /opt/staticsite.rb +fi + +if [ -z "$BUNDLE_WITHOUT" ]; then + echo "Bundle install with no 'without' options"; + RUBY_OPTIONS=""; +else + RUBY_OPTIONS="--without $BUNDLE_WITHOUT"; + echo "Bundle install with options $RUBY_OPTIONS"; +fi + +if [ -z "$BUNDLE_INSTALL_LOCATION" ]; then + echo "Defaulting gem installation directory to /tmp/bundle"; + BUNDLE_INSTALL_LOCATION="/tmp/bundle"; +else + echo "Gem installation directory is $BUNDLE_INSTALL_LOCATION"; +fi + +if [ -z "$RUBY_SITE_CONFIG_DIR" ]; then + echo "Defaulting site config directory to /home/site/config"; + RUBY_SITE_CONFIG_DIR="/home/site/config" +else + echo "site config directory is $RUBY_SITE_CONFIG_DIR"; +fi + +if [ -n "$SECRET_KEY_BASE" ] + then + echo 'Secret key base present' + else + echo 'Generating a secret key base' + export SECRET_KEY_BASE=$(ruby -rsecurerandom -e 'puts SecureRandom.hex(64)') +fi + +if [ -n "$RAILS_ENV" ] + then + echo "RAILS_ENV set to $RAILS_ENV" + else + echo 'RAILS_ENV not set, default to production' + export RAILS_ENV='production' +fi + +echo 'Removing any leftover pids if present' +rm -f tmp/pids/* ; + +# Support zipped gems +export ZIPPED_GEMS=0 +if [ -f "${RUBY_SITE_CONFIG_DIR}/gems.tgz" ] + then + echo "gems.tgz detected, beginning unzipping process" + echo "unzipping..." + mkdir -p $BUNDLE_INSTALL_LOCATION + cp ${RUBY_SITE_CONFIG_DIR}/gems.tgz /tmp + tar -C $BUNDLE_INSTALL_LOCATION -xf /tmp/gems.tgz + + echo 'Removing bundler config' + rm -f ${BUNDLE_INSTALL_LOCATION}/config + + export ZIPPED_GEMS=1 +fi + +export CHECK_PASSED=0 +echo 'Running bundle check' +if [ "$ZIPPED_GEMS" -eq 1 ] + then + bundle config --global path $BUNDLE_INSTALL_LOCATION + if bundle check | grep satisfied + then + echo 'dependency check passed' + export CHECK_PASSED=1 + else + echo 'missing dependencies, try redeploying' + echo `bundle check` + fi + else + bundle config --local path "vendor/bundle" + if bundle check --path "vendor/bundle" | grep satisfied + then + echo 'dependency check passed' + export CHECK_PASSED=1 + else + echo 'missing dependencies, try redeploying' + echo `bundle check --path "vendor/bundle"` + fi +fi + +if [ "$CHECK_PASSED" -eq 0 ] + then + if [ "$ZIPPED_GEMS" -eq 1 ] + then + echo "running bundle install $RUBY_OPTIONS --no-deployment" + bundle install --no-deployment $RUBY_OPTIONS + else + echo "running bundle install $RUBY_OPTIONS --local --path vendor/bundle" + bundle install $RUBY_OPTIONS --local --path vendor/bundle + fi +fi + +if [ -n "$GEM_PRISTINE" ] + then + echo 'running "gem pristine --all"' + bundle exec gem pristine --all +fi + +if [ $# -ne 0 ] + then + echo "Executing $@" + exec "$@" + else + echo "defaulting to command: \"bundle exec rails server -e $RAILS_ENV -p $PORT\"" + exec bundle exec rails server -b 0.0.0.0 -e "$RAILS_ENV" -p "$PORT" +fi \ No newline at end of file diff --git a/2.3.3/staticsite.rb b/2.3.3/staticsite.rb new file mode 100644 index 0000000..052cbb1 --- /dev/null +++ b/2.3.3/staticsite.rb @@ -0,0 +1,7 @@ +require 'webrick' +options = { + :Port => ENV["PORT"].to_i, + :DirectoryIndex => ["hostingstart.html"], + :DocumentRoot => '.' +} +WEBrick::HTTPServer.new(options).start diff --git a/base_images/2.3.3/Dockerfile b/base_images/2.3.3/Dockerfile new file mode 100644 index 0000000..311bd8b --- /dev/null +++ b/base_images/2.3.3/Dockerfile @@ -0,0 +1,53 @@ +FROM buildpack-deps:jessie-curl +LABEL maintainer="Azure App Services Container Images " + +RUN apt-get update -qq + +# Dependencies for various ruby and rubygem installations +RUN apt-get install -y git --no-install-recommends +RUN apt-get install -y libreadline-dev bzip2 build-essential libssl-dev zlib1g-dev libpq-dev libsqlite3-dev \ + curl patch gawk g++ gcc make libc6-dev patch libreadline6-dev libyaml-dev sqlite3 autoconf \ + libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev bison libxslt-dev \ + libxml2-dev libmysqlclient-dev --no-install-recommends + +# rbenv +RUN git clone https://github.com/rbenv/rbenv.git /usr/local/.rbenv +RUN chmod -R 777 /usr/local/.rbenv + +ENV RBENV_ROOT="/usr/local/.rbenv" + +ENV PATH="$RBENV_ROOT/bin:/usr/local:$PATH" + +RUN git clone https://github.com/rbenv/ruby-build.git /usr/local/.rbenv/plugins/ruby-build +RUN chmod -R 777 /usr/local/.rbenv/plugins/ruby-build + +RUN /usr/local/.rbenv/plugins/ruby-build/install.sh + +# Install ruby 2.3.3 +ENV RUBY_CONFIGURE_OPTS=--disable-install-doc + +ENV RUBY_CFLAGS=-O3 + +RUN eval "$(rbenv init -)" \ + && export WEBSITES_LATEST_NODE_VERSION="2.3.3" \ + && rbenv install $WEBSITES_LATEST_NODE_VERSION \ + && rbenv rehash \ + && rbenv global $WEBSITES_LATEST_NODE_VERSION \ + && ls /usr/local -a \ + && gem install bundler --version "=1.13.6"\ + && chmod -R 777 /usr/local/.rbenv/versions \ + && chmod -R 777 /usr/local/.rbenv/version + +RUN eval "$(rbenv init -)" \ + && rbenv global $WEBSITES_LATEST_NODE_VERSION \ + && bundle config --global build.nokogiri -- --use-system-libraries + +# Because Nokogiri tries to build libraries on its own otherwise +ENV NOKOGIRI_USE_SYSTEM_LIBRARIES=true + +# SQL Server gem support +RUN apt-get install -y unixodbc-dev freetds-dev freetds-bin + +# Make temp directory for ruby images +RUN mkdir -p /tmp/bundle +RUN chmod 777 /tmp/bundle From 4eec8132d6186c3909e4452963f4393c88a21daf Mon Sep 17 00:00:00 2001 From: Patrick Lee <31744877+patricklee2@users.noreply.github.com> Date: Wed, 20 Mar 2019 15:10:27 -0700 Subject: [PATCH 07/11] add 2.5.5, 2.6.2 --- 2.5.5/Dockerfile | 37 +++++++++++ 2.5.5/README.txt | 1 + 2.5.5/hostingstart.html | 38 ++++++++++++ 2.5.5/init_container.sh | 26 ++++++++ 2.5.5/sshd_config | 15 +++++ 2.5.5/startup.sh | 116 +++++++++++++++++++++++++++++++++++ 2.5.5/staticsite.rb | 7 +++ 2.6.2/Dockerfile | 37 +++++++++++ 2.6.2/README.txt | 1 + 2.6.2/hostingstart.html | 38 ++++++++++++ 2.6.2/init_container.sh | 26 ++++++++ 2.6.2/sshd_config | 15 +++++ 2.6.2/startup.sh | 116 +++++++++++++++++++++++++++++++++++ 2.6.2/staticsite.rb | 7 +++ base_images/2.5.5/Dockerfile | 53 ++++++++++++++++ base_images/2.6.2/Dockerfile | 53 ++++++++++++++++ 16 files changed, 586 insertions(+) create mode 100644 2.5.5/Dockerfile create mode 100644 2.5.5/README.txt create mode 100644 2.5.5/hostingstart.html create mode 100644 2.5.5/init_container.sh create mode 100644 2.5.5/sshd_config create mode 100644 2.5.5/startup.sh create mode 100644 2.5.5/staticsite.rb create mode 100644 2.6.2/Dockerfile create mode 100644 2.6.2/README.txt create mode 100644 2.6.2/hostingstart.html create mode 100644 2.6.2/init_container.sh create mode 100644 2.6.2/sshd_config create mode 100644 2.6.2/startup.sh create mode 100644 2.6.2/staticsite.rb create mode 100644 base_images/2.5.5/Dockerfile create mode 100644 base_images/2.6.2/Dockerfile diff --git a/2.5.5/Dockerfile b/2.5.5/Dockerfile new file mode 100644 index 0000000..f3fcd4d --- /dev/null +++ b/2.5.5/Dockerfile @@ -0,0 +1,37 @@ +FROM appsvc/rubybase:2.5.5 +LABEL maintainer="Azure App Services Container Images " + +COPY init_container.sh /bin/ +COPY startup.sh /opt/ +COPY sshd_config /etc/ssh/ +COPY hostingstart.html /home/site/wwwroot/hostingstart.html +COPY staticsite.rb /opt/staticsite.rb + +RUN apt-get update -qq \ + && apt-get install -y nodejs openssh-server vim curl wget tcptraceroute --no-install-recommends \ + && echo "root:Docker!" | chpasswd \ + && echo "cd /home" >> /etc/bash.bashrc + +RUN eval "$(rbenv init -)" \ + && rbenv global 2.5.5 + +RUN chmod 755 /bin/init_container.sh \ + && mkdir -p /home/LogFiles/ \ + && chmod 755 /opt/startup.sh + +EXPOSE 2222 8080 + +ENV PORT 8080 +ENV SSH_PORT 2222 +ENV WEBSITE_ROLE_INSTANCE_ID localRoleInstance +ENV WEBSITE_INSTANCE_ID localInstance +ENV PATH ${PATH}:/home/site/wwwroot + +# install libssl1.0.2 +RUN wget http://ftp.us.debian.org/debian/pool/main/o/openssl1.0/libssl1.0.2_1.0.2q-1~deb9u1_amd64.deb \ + && apt-get install dialog \ + && dpkg -i libssl1.0.2_1.0.2q-1~deb9u1_amd64.deb + +WORKDIR /home/site/wwwroot + +ENTRYPOINT [ "/bin/init_container.sh" ] diff --git a/2.5.5/README.txt b/2.5.5/README.txt new file mode 100644 index 0000000..5c6c91f --- /dev/null +++ b/2.5.5/README.txt @@ -0,0 +1 @@ +This image is in development, not yet a working state. Use 2.3-1 for personal testing. diff --git a/2.5.5/hostingstart.html b/2.5.5/hostingstart.html new file mode 100644 index 0000000..580cc12 --- /dev/null +++ b/2.5.5/hostingstart.html @@ -0,0 +1,38 @@ + + + + + + + +Codestin Search App + + + + + + +
+
+Codestin Search App +
+
+

Your App Service app has been created

+

Go to your app's + +Quick Start guide in the Azure portal to get started or read our + +deployment documentation. +

+
+
+ + + + \ No newline at end of file diff --git a/2.5.5/init_container.sh b/2.5.5/init_container.sh new file mode 100644 index 0000000..3ef0a93 --- /dev/null +++ b/2.5.5/init_container.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +cat >/etc/motd < + \/ \/ \/ +A P P S E R V I C E O N L I N U X + +Documentation: http://aka.ms/webapp-linux +Ruby quickstart: https://aka.ms/ruby-qs + +EOL +cat /etc/motd + +sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config +service ssh start + +# Get environment variables to show up in SSH session +eval $(printenv | awk -F= '{print "export " $1"="$2 }' >> /etc/profile) + +eval "$(rbenv init -)" +rbenv global 2.5.5 +/opt/startup.sh "$@" + diff --git a/2.5.5/sshd_config b/2.5.5/sshd_config new file mode 100644 index 0000000..7787ce7 --- /dev/null +++ b/2.5.5/sshd_config @@ -0,0 +1,15 @@ +# This is ssh server systemwide configuration file. +# +# /etc/sshd_config + +Port SSH_PORT +ListenAddress 0.0.0.0 +LoginGraceTime 180 +X11Forwarding yes +Ciphers aes128-cbc,3des-cbc,aes256-cbc +MACs hmac-sha1,hmac-sha1-96 +StrictModes yes +SyslogFacility DAEMON +PasswordAuthentication yes +PermitEmptyPasswords no +PermitRootLogin yes diff --git a/2.5.5/startup.sh b/2.5.5/startup.sh new file mode 100644 index 0000000..795b27f --- /dev/null +++ b/2.5.5/startup.sh @@ -0,0 +1,116 @@ +#!/usr/bin/env bash + +if ! [ -e /home/site/wwwroot/Gemfile ] && [ -z "$RAILS_IGNORE_SPLASH" ] + then + echo 'No Gemfile found and RAILS_IGNORE_SPLASH not set, running default static site' + exec ruby /opt/staticsite.rb +fi + +if [ -z "$BUNDLE_WITHOUT" ]; then + echo "Bundle install with no 'without' options"; + RUBY_OPTIONS=""; +else + RUBY_OPTIONS="--without $BUNDLE_WITHOUT"; + echo "Bundle install with options $RUBY_OPTIONS"; +fi + +if [ -z "$BUNDLE_INSTALL_LOCATION" ]; then + echo "Defaulting gem installation directory to /tmp/bundle"; + BUNDLE_INSTALL_LOCATION="/tmp/bundle"; +else + echo "Gem installation directory is $BUNDLE_INSTALL_LOCATION"; +fi + +if [ -z "$RUBY_SITE_CONFIG_DIR" ]; then + echo "Defaulting site config directory to /home/site/config"; + RUBY_SITE_CONFIG_DIR="/home/site/config" +else + echo "site config directory is $RUBY_SITE_CONFIG_DIR"; +fi + +if [ -n "$SECRET_KEY_BASE" ] + then + echo 'Secret key base present' + else + echo 'Generating a secret key base' + export SECRET_KEY_BASE=$(ruby -rsecurerandom -e 'puts SecureRandom.hex(64)') +fi + +if [ -n "$RAILS_ENV" ] + then + echo "RAILS_ENV set to $RAILS_ENV" + else + echo 'RAILS_ENV not set, default to production' + export RAILS_ENV='production' +fi + +echo 'Removing any leftover pids if present' +rm -f tmp/pids/* ; + +# Support zipped gems +export ZIPPED_GEMS=0 +if [ -f "${RUBY_SITE_CONFIG_DIR}/gems.tgz" ] + then + echo "gems.tgz detected, beginning unzipping process" + echo "unzipping..." + mkdir -p $BUNDLE_INSTALL_LOCATION + cp ${RUBY_SITE_CONFIG_DIR}/gems.tgz /tmp + tar -C $BUNDLE_INSTALL_LOCATION -xf /tmp/gems.tgz + + echo 'Removing bundler config' + rm -f ${BUNDLE_INSTALL_LOCATION}/config + + export ZIPPED_GEMS=1 +fi + +export CHECK_PASSED=0 +echo 'Running bundle check' +if [ "$ZIPPED_GEMS" -eq 1 ] + then + bundle config --global path $BUNDLE_INSTALL_LOCATION + if bundle check | grep satisfied + then + echo 'dependency check passed' + export CHECK_PASSED=1 + else + echo 'missing dependencies, try redeploying' + echo `bundle check` + fi + else + bundle config --local path "vendor/bundle" + if bundle check --path "vendor/bundle" | grep satisfied + then + echo 'dependency check passed' + export CHECK_PASSED=1 + else + echo 'missing dependencies, try redeploying' + echo `bundle check --path "vendor/bundle"` + fi +fi + +if [ "$CHECK_PASSED" -eq 0 ] + then + if [ "$ZIPPED_GEMS" -eq 1 ] + then + echo "running bundle install $RUBY_OPTIONS --no-deployment" + bundle install --no-deployment $RUBY_OPTIONS + else + echo "running bundle install $RUBY_OPTIONS --local --path vendor/bundle" + bundle install $RUBY_OPTIONS --local --path vendor/bundle + fi +fi + +if [ -n "$GEM_PRISTINE" ] + then + echo 'running "gem pristine --all"' + bundle exec gem pristine --all +fi + +if [ $# -ne 0 ] + then + echo "Executing $@" + exec "$@" + else + echo "defaulting to command: \"bundle exec rails server -e $RAILS_ENV -p $PORT\"" + exec bundle exec rails server -b 0.0.0.0 -e "$RAILS_ENV" -p "$PORT" +fi \ No newline at end of file diff --git a/2.5.5/staticsite.rb b/2.5.5/staticsite.rb new file mode 100644 index 0000000..052cbb1 --- /dev/null +++ b/2.5.5/staticsite.rb @@ -0,0 +1,7 @@ +require 'webrick' +options = { + :Port => ENV["PORT"].to_i, + :DirectoryIndex => ["hostingstart.html"], + :DocumentRoot => '.' +} +WEBrick::HTTPServer.new(options).start diff --git a/2.6.2/Dockerfile b/2.6.2/Dockerfile new file mode 100644 index 0000000..41af0d8 --- /dev/null +++ b/2.6.2/Dockerfile @@ -0,0 +1,37 @@ +FROM appsvc/rubybase:2.6.2 +LABEL maintainer="Azure App Services Container Images " + +COPY init_container.sh /bin/ +COPY startup.sh /opt/ +COPY sshd_config /etc/ssh/ +COPY hostingstart.html /home/site/wwwroot/hostingstart.html +COPY staticsite.rb /opt/staticsite.rb + +RUN apt-get update -qq \ + && apt-get install -y nodejs openssh-server vim curl wget tcptraceroute --no-install-recommends \ + && echo "root:Docker!" | chpasswd \ + && echo "cd /home" >> /etc/bash.bashrc + +RUN eval "$(rbenv init -)" \ + && rbenv global 2.6.2 + +RUN chmod 755 /bin/init_container.sh \ + && mkdir -p /home/LogFiles/ \ + && chmod 755 /opt/startup.sh + +EXPOSE 2222 8080 + +ENV PORT 8080 +ENV SSH_PORT 2222 +ENV WEBSITE_ROLE_INSTANCE_ID localRoleInstance +ENV WEBSITE_INSTANCE_ID localInstance +ENV PATH ${PATH}:/home/site/wwwroot + +# install libssl1.0.2 +RUN wget http://ftp.us.debian.org/debian/pool/main/o/openssl1.0/libssl1.0.2_1.0.2q-1~deb9u1_amd64.deb \ + && apt-get install dialog \ + && dpkg -i libssl1.0.2_1.0.2q-1~deb9u1_amd64.deb + +WORKDIR /home/site/wwwroot + +ENTRYPOINT [ "/bin/init_container.sh" ] diff --git a/2.6.2/README.txt b/2.6.2/README.txt new file mode 100644 index 0000000..5c6c91f --- /dev/null +++ b/2.6.2/README.txt @@ -0,0 +1 @@ +This image is in development, not yet a working state. Use 2.3-1 for personal testing. diff --git a/2.6.2/hostingstart.html b/2.6.2/hostingstart.html new file mode 100644 index 0000000..580cc12 --- /dev/null +++ b/2.6.2/hostingstart.html @@ -0,0 +1,38 @@ + + + + + + + +Codestin Search App + + + + + + +
+
+Codestin Search App +
+
+

Your App Service app has been created

+

Go to your app's + +Quick Start guide in the Azure portal to get started or read our + +deployment documentation. +

+
+
+ + + + \ No newline at end of file diff --git a/2.6.2/init_container.sh b/2.6.2/init_container.sh new file mode 100644 index 0000000..cb6f798 --- /dev/null +++ b/2.6.2/init_container.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +cat >/etc/motd < + \/ \/ \/ +A P P S E R V I C E O N L I N U X + +Documentation: http://aka.ms/webapp-linux +Ruby quickstart: https://aka.ms/ruby-qs + +EOL +cat /etc/motd + +sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config +service ssh start + +# Get environment variables to show up in SSH session +eval $(printenv | awk -F= '{print "export " $1"="$2 }' >> /etc/profile) + +eval "$(rbenv init -)" +rbenv global 2.6.2 +/opt/startup.sh "$@" + diff --git a/2.6.2/sshd_config b/2.6.2/sshd_config new file mode 100644 index 0000000..7787ce7 --- /dev/null +++ b/2.6.2/sshd_config @@ -0,0 +1,15 @@ +# This is ssh server systemwide configuration file. +# +# /etc/sshd_config + +Port SSH_PORT +ListenAddress 0.0.0.0 +LoginGraceTime 180 +X11Forwarding yes +Ciphers aes128-cbc,3des-cbc,aes256-cbc +MACs hmac-sha1,hmac-sha1-96 +StrictModes yes +SyslogFacility DAEMON +PasswordAuthentication yes +PermitEmptyPasswords no +PermitRootLogin yes diff --git a/2.6.2/startup.sh b/2.6.2/startup.sh new file mode 100644 index 0000000..795b27f --- /dev/null +++ b/2.6.2/startup.sh @@ -0,0 +1,116 @@ +#!/usr/bin/env bash + +if ! [ -e /home/site/wwwroot/Gemfile ] && [ -z "$RAILS_IGNORE_SPLASH" ] + then + echo 'No Gemfile found and RAILS_IGNORE_SPLASH not set, running default static site' + exec ruby /opt/staticsite.rb +fi + +if [ -z "$BUNDLE_WITHOUT" ]; then + echo "Bundle install with no 'without' options"; + RUBY_OPTIONS=""; +else + RUBY_OPTIONS="--without $BUNDLE_WITHOUT"; + echo "Bundle install with options $RUBY_OPTIONS"; +fi + +if [ -z "$BUNDLE_INSTALL_LOCATION" ]; then + echo "Defaulting gem installation directory to /tmp/bundle"; + BUNDLE_INSTALL_LOCATION="/tmp/bundle"; +else + echo "Gem installation directory is $BUNDLE_INSTALL_LOCATION"; +fi + +if [ -z "$RUBY_SITE_CONFIG_DIR" ]; then + echo "Defaulting site config directory to /home/site/config"; + RUBY_SITE_CONFIG_DIR="/home/site/config" +else + echo "site config directory is $RUBY_SITE_CONFIG_DIR"; +fi + +if [ -n "$SECRET_KEY_BASE" ] + then + echo 'Secret key base present' + else + echo 'Generating a secret key base' + export SECRET_KEY_BASE=$(ruby -rsecurerandom -e 'puts SecureRandom.hex(64)') +fi + +if [ -n "$RAILS_ENV" ] + then + echo "RAILS_ENV set to $RAILS_ENV" + else + echo 'RAILS_ENV not set, default to production' + export RAILS_ENV='production' +fi + +echo 'Removing any leftover pids if present' +rm -f tmp/pids/* ; + +# Support zipped gems +export ZIPPED_GEMS=0 +if [ -f "${RUBY_SITE_CONFIG_DIR}/gems.tgz" ] + then + echo "gems.tgz detected, beginning unzipping process" + echo "unzipping..." + mkdir -p $BUNDLE_INSTALL_LOCATION + cp ${RUBY_SITE_CONFIG_DIR}/gems.tgz /tmp + tar -C $BUNDLE_INSTALL_LOCATION -xf /tmp/gems.tgz + + echo 'Removing bundler config' + rm -f ${BUNDLE_INSTALL_LOCATION}/config + + export ZIPPED_GEMS=1 +fi + +export CHECK_PASSED=0 +echo 'Running bundle check' +if [ "$ZIPPED_GEMS" -eq 1 ] + then + bundle config --global path $BUNDLE_INSTALL_LOCATION + if bundle check | grep satisfied + then + echo 'dependency check passed' + export CHECK_PASSED=1 + else + echo 'missing dependencies, try redeploying' + echo `bundle check` + fi + else + bundle config --local path "vendor/bundle" + if bundle check --path "vendor/bundle" | grep satisfied + then + echo 'dependency check passed' + export CHECK_PASSED=1 + else + echo 'missing dependencies, try redeploying' + echo `bundle check --path "vendor/bundle"` + fi +fi + +if [ "$CHECK_PASSED" -eq 0 ] + then + if [ "$ZIPPED_GEMS" -eq 1 ] + then + echo "running bundle install $RUBY_OPTIONS --no-deployment" + bundle install --no-deployment $RUBY_OPTIONS + else + echo "running bundle install $RUBY_OPTIONS --local --path vendor/bundle" + bundle install $RUBY_OPTIONS --local --path vendor/bundle + fi +fi + +if [ -n "$GEM_PRISTINE" ] + then + echo 'running "gem pristine --all"' + bundle exec gem pristine --all +fi + +if [ $# -ne 0 ] + then + echo "Executing $@" + exec "$@" + else + echo "defaulting to command: \"bundle exec rails server -e $RAILS_ENV -p $PORT\"" + exec bundle exec rails server -b 0.0.0.0 -e "$RAILS_ENV" -p "$PORT" +fi \ No newline at end of file diff --git a/2.6.2/staticsite.rb b/2.6.2/staticsite.rb new file mode 100644 index 0000000..052cbb1 --- /dev/null +++ b/2.6.2/staticsite.rb @@ -0,0 +1,7 @@ +require 'webrick' +options = { + :Port => ENV["PORT"].to_i, + :DirectoryIndex => ["hostingstart.html"], + :DocumentRoot => '.' +} +WEBrick::HTTPServer.new(options).start diff --git a/base_images/2.5.5/Dockerfile b/base_images/2.5.5/Dockerfile new file mode 100644 index 0000000..aaeedc8 --- /dev/null +++ b/base_images/2.5.5/Dockerfile @@ -0,0 +1,53 @@ +FROM buildpack-deps:jessie-curl +LABEL maintainer="Azure App Services Container Images " + +RUN apt-get update -qq + +# Dependencies for various ruby and rubygem installations +RUN apt-get install -y git --no-install-recommends +RUN apt-get install -y libreadline-dev bzip2 build-essential libssl-dev zlib1g-dev libpq-dev libsqlite3-dev \ + curl patch gawk g++ gcc make libc6-dev patch libreadline6-dev libyaml-dev sqlite3 autoconf \ + libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev bison libxslt-dev \ + libxml2-dev libmysqlclient-dev --no-install-recommends + +# rbenv +RUN git clone https://github.com/rbenv/rbenv.git /usr/local/.rbenv +RUN chmod -R 777 /usr/local/.rbenv + +ENV RBENV_ROOT="/usr/local/.rbenv" + +ENV PATH="$RBENV_ROOT/bin:/usr/local:$PATH" + +RUN git clone https://github.com/rbenv/ruby-build.git /usr/local/.rbenv/plugins/ruby-build +RUN chmod -R 777 /usr/local/.rbenv/plugins/ruby-build + +RUN /usr/local/.rbenv/plugins/ruby-build/install.sh + +# Install ruby 2.5.5 +ENV RUBY_CONFIGURE_OPTS=--disable-install-doc + +ENV RUBY_CFLAGS=-O3 + +RUN eval "$(rbenv init -)" \ + && export WEBSITES_LATEST_NODE_VERSION="2.5.5" \ + && rbenv install $WEBSITES_LATEST_NODE_VERSION \ + && rbenv rehash \ + && rbenv global $WEBSITES_LATEST_NODE_VERSION \ + && ls /usr/local -a \ + && gem install bundler --version "=1.13.6"\ + && chmod -R 777 /usr/local/.rbenv/versions \ + && chmod -R 777 /usr/local/.rbenv/version + +RUN eval "$(rbenv init -)" \ + && rbenv global $WEBSITES_LATEST_NODE_VERSION \ + && bundle config --global build.nokogiri -- --use-system-libraries + +# Because Nokogiri tries to build libraries on its own otherwise +ENV NOKOGIRI_USE_SYSTEM_LIBRARIES=true + +# SQL Server gem support +RUN apt-get install -y unixodbc-dev freetds-dev freetds-bin + +# Make temp directory for ruby images +RUN mkdir -p /tmp/bundle +RUN chmod 777 /tmp/bundle diff --git a/base_images/2.6.2/Dockerfile b/base_images/2.6.2/Dockerfile new file mode 100644 index 0000000..dcf9964 --- /dev/null +++ b/base_images/2.6.2/Dockerfile @@ -0,0 +1,53 @@ +FROM buildpack-deps:jessie-curl +LABEL maintainer="Azure App Services Container Images " + +RUN apt-get update -qq + +# Dependencies for various ruby and rubygem installations +RUN apt-get install -y git --no-install-recommends +RUN apt-get install -y libreadline-dev bzip2 build-essential libssl-dev zlib1g-dev libpq-dev libsqlite3-dev \ + curl patch gawk g++ gcc make libc6-dev patch libreadline6-dev libyaml-dev sqlite3 autoconf \ + libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev bison libxslt-dev \ + libxml2-dev libmysqlclient-dev --no-install-recommends + +# rbenv +RUN git clone https://github.com/rbenv/rbenv.git /usr/local/.rbenv +RUN chmod -R 777 /usr/local/.rbenv + +ENV RBENV_ROOT="/usr/local/.rbenv" + +ENV PATH="$RBENV_ROOT/bin:/usr/local:$PATH" + +RUN git clone https://github.com/rbenv/ruby-build.git /usr/local/.rbenv/plugins/ruby-build +RUN chmod -R 777 /usr/local/.rbenv/plugins/ruby-build + +RUN /usr/local/.rbenv/plugins/ruby-build/install.sh + +# Install ruby 2.6.2 +ENV RUBY_CONFIGURE_OPTS=--disable-install-doc + +ENV RUBY_CFLAGS=-O3 + +RUN eval "$(rbenv init -)" \ + && export WEBSITES_LATEST_NODE_VERSION="2.6.2" \ + && rbenv install $WEBSITES_LATEST_NODE_VERSION \ + && rbenv rehash \ + && rbenv global $WEBSITES_LATEST_NODE_VERSION \ + && ls /usr/local -a \ + && gem install bundler --version "=1.13.6"\ + && chmod -R 777 /usr/local/.rbenv/versions \ + && chmod -R 777 /usr/local/.rbenv/version + +RUN eval "$(rbenv init -)" \ + && rbenv global $WEBSITES_LATEST_NODE_VERSION \ + && bundle config --global build.nokogiri -- --use-system-libraries + +# Because Nokogiri tries to build libraries on its own otherwise +ENV NOKOGIRI_USE_SYSTEM_LIBRARIES=true + +# SQL Server gem support +RUN apt-get install -y unixodbc-dev freetds-dev freetds-bin + +# Make temp directory for ruby images +RUN mkdir -p /tmp/bundle +RUN chmod 777 /tmp/bundle From bc734f0bef95c415a92098443c3e4d4b8a53916b Mon Sep 17 00:00:00 2001 From: Patrick Lee <31744877+patricklee2@users.noreply.github.com> Date: Tue, 26 Mar 2019 15:09:44 -0700 Subject: [PATCH 08/11] jessie moved to debian archives --- base_images/2.3.3/Dockerfile | 10 +++++++++- base_images/2.3.8/Dockerfile | 10 +++++++++- base_images/2.4.5/Dockerfile | 10 +++++++++- base_images/2.5.5/Dockerfile | 10 +++++++++- base_images/2.6.2/Dockerfile | 10 +++++++++- 5 files changed, 45 insertions(+), 5 deletions(-) diff --git a/base_images/2.3.3/Dockerfile b/base_images/2.3.3/Dockerfile index 311bd8b..71da404 100644 --- a/base_images/2.3.3/Dockerfile +++ b/base_images/2.3.3/Dockerfile @@ -1,7 +1,15 @@ FROM buildpack-deps:jessie-curl LABEL maintainer="Azure App Services Container Images " -RUN apt-get update -qq +RUN echo "deb http://deb.debian.org/debian/ jessie main" > /etc/apt/sources.list \ + && echo "deb-src http://deb.debian.org/debian/ jessie main" >> /etc/apt/sources.list \ + && echo "deb http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list \ + && echo "deb-src http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list \ + && echo "deb http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list \ + && echo "deb-src http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list \ + && echo "Acquire::Check-Valid-Until \"false\";" > /etc/apt/apt.conf + +RUN apt-get update -qq # Dependencies for various ruby and rubygem installations RUN apt-get install -y git --no-install-recommends diff --git a/base_images/2.3.8/Dockerfile b/base_images/2.3.8/Dockerfile index 1803f08..0320394 100644 --- a/base_images/2.3.8/Dockerfile +++ b/base_images/2.3.8/Dockerfile @@ -1,7 +1,15 @@ FROM buildpack-deps:jessie-curl LABEL maintainer="Azure App Services Container Images " -RUN apt-get update -qq +RUN echo "deb http://deb.debian.org/debian/ jessie main" > /etc/apt/sources.list \ + && echo "deb-src http://deb.debian.org/debian/ jessie main" >> /etc/apt/sources.list \ + && echo "deb http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list \ + && echo "deb-src http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list \ + && echo "deb http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list \ + && echo "deb-src http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list \ + && echo "Acquire::Check-Valid-Until \"false\";" > /etc/apt/apt.conf + +RUN apt-get update -qq # Dependencies for various ruby and rubygem installations RUN apt-get install -y git --no-install-recommends diff --git a/base_images/2.4.5/Dockerfile b/base_images/2.4.5/Dockerfile index e3741c1..17b8a8b 100644 --- a/base_images/2.4.5/Dockerfile +++ b/base_images/2.4.5/Dockerfile @@ -1,7 +1,15 @@ FROM buildpack-deps:jessie-curl LABEL maintainer="Azure App Services Container Images " -RUN apt-get update -qq +RUN echo "deb http://deb.debian.org/debian/ jessie main" > /etc/apt/sources.list \ + && echo "deb-src http://deb.debian.org/debian/ jessie main" >> /etc/apt/sources.list \ + && echo "deb http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list \ + && echo "deb-src http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list \ + && echo "deb http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list \ + && echo "deb-src http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list \ + && echo "Acquire::Check-Valid-Until \"false\";" > /etc/apt/apt.conf + +RUN apt-get update -qq # Dependencies for various ruby and rubygem installations RUN apt-get install -y git --no-install-recommends diff --git a/base_images/2.5.5/Dockerfile b/base_images/2.5.5/Dockerfile index aaeedc8..09d3c74 100644 --- a/base_images/2.5.5/Dockerfile +++ b/base_images/2.5.5/Dockerfile @@ -1,7 +1,15 @@ FROM buildpack-deps:jessie-curl LABEL maintainer="Azure App Services Container Images " -RUN apt-get update -qq +RUN echo "deb http://deb.debian.org/debian/ jessie main" > /etc/apt/sources.list \ + && echo "deb-src http://deb.debian.org/debian/ jessie main" >> /etc/apt/sources.list \ + && echo "deb http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list \ + && echo "deb-src http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list \ + && echo "deb http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list \ + && echo "deb-src http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list \ + && echo "Acquire::Check-Valid-Until \"false\";" > /etc/apt/apt.conf + +RUN apt-get update -qq # Dependencies for various ruby and rubygem installations RUN apt-get install -y git --no-install-recommends diff --git a/base_images/2.6.2/Dockerfile b/base_images/2.6.2/Dockerfile index dcf9964..afb02c2 100644 --- a/base_images/2.6.2/Dockerfile +++ b/base_images/2.6.2/Dockerfile @@ -1,7 +1,15 @@ FROM buildpack-deps:jessie-curl LABEL maintainer="Azure App Services Container Images " -RUN apt-get update -qq +RUN echo "deb http://deb.debian.org/debian/ jessie main" > /etc/apt/sources.list \ + && echo "deb-src http://deb.debian.org/debian/ jessie main" >> /etc/apt/sources.list \ + && echo "deb http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list \ + && echo "deb-src http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list \ + && echo "deb http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list \ + && echo "deb-src http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list \ + && echo "Acquire::Check-Valid-Until \"false\";" > /etc/apt/apt.conf + +RUN apt-get update -qq # Dependencies for various ruby and rubygem installations RUN apt-get install -y git --no-install-recommends From ae2e4d6fcf41bd07679e518b00de71cbb7b4ef88 Mon Sep 17 00:00:00 2001 From: Patrick Lee <31744877+patricklee2@users.noreply.github.com> Date: Tue, 26 Mar 2019 14:40:21 -0700 Subject: [PATCH 09/11] new hosting start page --- 2.3.3/Dockerfile | 2 +- 2.3.3/hostingstart.html | 40 ++-------------------------------------- 2.3.3/staticsite.rb | 2 +- 2.3.8/Dockerfile | 2 +- 2.3.8/hostingstart.html | 40 ++-------------------------------------- 2.3.8/staticsite.rb | 2 +- 2.4.5/Dockerfile | 2 +- 2.4.5/hostingstart.html | 40 ++-------------------------------------- 2.4.5/staticsite.rb | 2 +- 2.5.5/Dockerfile | 2 +- 2.5.5/hostingstart.html | 40 ++-------------------------------------- 2.5.5/staticsite.rb | 2 +- 2.6.2/Dockerfile | 2 +- 2.6.2/hostingstart.html | 40 ++-------------------------------------- 2.6.2/staticsite.rb | 2 +- 15 files changed, 20 insertions(+), 200 deletions(-) diff --git a/2.3.3/Dockerfile b/2.3.3/Dockerfile index 7e6c991..005ae96 100644 --- a/2.3.3/Dockerfile +++ b/2.3.3/Dockerfile @@ -4,7 +4,7 @@ LABEL maintainer="Azure App Services Container Images - - - - - - -Codestin Search App - - - - - - -
-
-Codestin Search App -
-
-

Your App Service app has been created

-

Go to your app's - -Quick Start guide in the Azure portal to get started or read our - -deployment documentation. -

-
-
- - - - \ No newline at end of file + +Codestin Search App

Hey, Ruby developers!


Your app service is up and running.

Time to take the next step and deploy your code.

Have your code ready?
Use deployment center to get code published from your client or setup continuous deployment.

Don't have your code yet?
Follow our quickstart guide and you'll have a full app ready in 5 minutes or less.

\ No newline at end of file diff --git a/2.3.3/staticsite.rb b/2.3.3/staticsite.rb index 052cbb1..34814f7 100644 --- a/2.3.3/staticsite.rb +++ b/2.3.3/staticsite.rb @@ -2,6 +2,6 @@ options = { :Port => ENV["PORT"].to_i, :DirectoryIndex => ["hostingstart.html"], - :DocumentRoot => '.' + :DocumentRoot => '/opt/startup' } WEBrick::HTTPServer.new(options).start diff --git a/2.3.8/Dockerfile b/2.3.8/Dockerfile index 1ba4c9e..ca73184 100644 --- a/2.3.8/Dockerfile +++ b/2.3.8/Dockerfile @@ -4,7 +4,7 @@ LABEL maintainer="Azure App Services Container Images - - - - - - -Codestin Search App - - - - - - -
-
-Codestin Search App -
-
-

Your App Service app has been created

-

Go to your app's - -Quick Start guide in the Azure portal to get started or read our - -deployment documentation. -

-
-
- - - - \ No newline at end of file + +Codestin Search App

Hey, Ruby developers!


Your app service is up and running.

Time to take the next step and deploy your code.

Have your code ready?
Use deployment center to get code published from your client or setup continuous deployment.

Don't have your code yet?
Follow our quickstart guide and you'll have a full app ready in 5 minutes or less.

\ No newline at end of file diff --git a/2.3.8/staticsite.rb b/2.3.8/staticsite.rb index 052cbb1..34814f7 100644 --- a/2.3.8/staticsite.rb +++ b/2.3.8/staticsite.rb @@ -2,6 +2,6 @@ options = { :Port => ENV["PORT"].to_i, :DirectoryIndex => ["hostingstart.html"], - :DocumentRoot => '.' + :DocumentRoot => '/opt/startup' } WEBrick::HTTPServer.new(options).start diff --git a/2.4.5/Dockerfile b/2.4.5/Dockerfile index fcece2a..9105026 100644 --- a/2.4.5/Dockerfile +++ b/2.4.5/Dockerfile @@ -4,7 +4,7 @@ LABEL maintainer="Azure App Services Container Images - - - - - - -Codestin Search App - - - - - - -
-
-Codestin Search App -
-
-

Your App Service app has been created

-

Go to your app's - -Quick Start guide in the Azure portal to get started or read our - -deployment documentation. -

-
-
- - - - \ No newline at end of file + +Codestin Search App

Hey, Ruby developers!


Your app service is up and running.

Time to take the next step and deploy your code.

Have your code ready?
Use deployment center to get code published from your client or setup continuous deployment.

Don't have your code yet?
Follow our quickstart guide and you'll have a full app ready in 5 minutes or less.

\ No newline at end of file diff --git a/2.4.5/staticsite.rb b/2.4.5/staticsite.rb index 052cbb1..34814f7 100644 --- a/2.4.5/staticsite.rb +++ b/2.4.5/staticsite.rb @@ -2,6 +2,6 @@ options = { :Port => ENV["PORT"].to_i, :DirectoryIndex => ["hostingstart.html"], - :DocumentRoot => '.' + :DocumentRoot => '/opt/startup' } WEBrick::HTTPServer.new(options).start diff --git a/2.5.5/Dockerfile b/2.5.5/Dockerfile index f3fcd4d..8d52ff8 100644 --- a/2.5.5/Dockerfile +++ b/2.5.5/Dockerfile @@ -4,7 +4,7 @@ LABEL maintainer="Azure App Services Container Images - - - - - - -Codestin Search App - - - - - - -
-
-Codestin Search App -
-
-

Your App Service app has been created

-

Go to your app's - -Quick Start guide in the Azure portal to get started or read our - -deployment documentation. -

-
-
- - - - \ No newline at end of file + +Codestin Search App

Hey, Ruby developers!


Your app service is up and running.

Time to take the next step and deploy your code.

Have your code ready?
Use deployment center to get code published from your client or setup continuous deployment.

Don't have your code yet?
Follow our quickstart guide and you'll have a full app ready in 5 minutes or less.

\ No newline at end of file diff --git a/2.5.5/staticsite.rb b/2.5.5/staticsite.rb index 052cbb1..34814f7 100644 --- a/2.5.5/staticsite.rb +++ b/2.5.5/staticsite.rb @@ -2,6 +2,6 @@ options = { :Port => ENV["PORT"].to_i, :DirectoryIndex => ["hostingstart.html"], - :DocumentRoot => '.' + :DocumentRoot => '/opt/startup' } WEBrick::HTTPServer.new(options).start diff --git a/2.6.2/Dockerfile b/2.6.2/Dockerfile index 41af0d8..04e9c92 100644 --- a/2.6.2/Dockerfile +++ b/2.6.2/Dockerfile @@ -4,7 +4,7 @@ LABEL maintainer="Azure App Services Container Images - - - - - - -Codestin Search App - - - - - - -
-
-Codestin Search App -
-
-

Your App Service app has been created

-

Go to your app's - -Quick Start guide in the Azure portal to get started or read our - -deployment documentation. -

-
-
- - - - \ No newline at end of file + +Codestin Search App

Hey, Ruby developers!


Your app service is up and running.

Time to take the next step and deploy your code.

Have your code ready?
Use deployment center to get code published from your client or setup continuous deployment.

Don't have your code yet?
Follow our quickstart guide and you'll have a full app ready in 5 minutes or less.

\ No newline at end of file diff --git a/2.6.2/staticsite.rb b/2.6.2/staticsite.rb index 052cbb1..34814f7 100644 --- a/2.6.2/staticsite.rb +++ b/2.6.2/staticsite.rb @@ -2,6 +2,6 @@ options = { :Port => ENV["PORT"].to_i, :DirectoryIndex => ["hostingstart.html"], - :DocumentRoot => '.' + :DocumentRoot => '/opt/startup' } WEBrick::HTTPServer.new(options).start From b5dd7bc1340011a1ac4d38529ee85daa0439c2fc Mon Sep 17 00:00:00 2001 From: Patrick <31744877+patricklee2@users.noreply.github.com> Date: Fri, 7 Jun 2019 12:56:48 -0700 Subject: [PATCH 10/11] Create pull_request_template.md --- pull_request_template.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 pull_request_template.md diff --git a/pull_request_template.md b/pull_request_template.md new file mode 100644 index 0000000..c806487 --- /dev/null +++ b/pull_request_template.md @@ -0,0 +1,5 @@ + + +--------------------------- +* [ ] Are these changes auto-generated from Azure-App-Service/php-templates +* [ ] Have you made the same changes to Azure-App-Service/php-templates From 073c3aff5ac55ba403997d5b2d74fe90603c2664 Mon Sep 17 00:00:00 2001 From: Patrick <31744877+patricklee2@users.noreply.github.com> Date: Fri, 7 Jun 2019 13:10:53 -0700 Subject: [PATCH 11/11] Update pull_request_template.md --- pull_request_template.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pull_request_template.md b/pull_request_template.md index c806487..a468a6d 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -1,5 +1,5 @@ --------------------------- -* [ ] Are these changes auto-generated from Azure-App-Service/php-templates -* [ ] Have you made the same changes to Azure-App-Service/php-templates +* [ ] Are these changes auto-generated from [ruby-template](https://github.com/Azure-App-Service/ruby-template) +* [ ] Have you made the same changes to [ruby-template](https://github.com/Azure-App-Service/ruby-template)