diff --git a/2.3.3/Dockerfile b/2.3.3/Dockerfile index deb08df..005ae96 100644 --- a/2.3.3/Dockerfile +++ b/2.3.3/Dockerfile @@ -1,10 +1,10 @@ FROM appsvc/rubybase:2.3.3 -MAINTAINER Azure App Services Container Images +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 hostingstart.html /opt/startup/hostingstart.html COPY staticsite.rb /opt/staticsite.rb RUN apt-get update -qq \ @@ -22,14 +22,15 @@ 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 # 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.3/hostingstart.html b/2.3.3/hostingstart.html index 21d974c..d55a3f6 100644 --- a/2.3.3/hostingstart.html +++ b/2.3.3/hostingstart.html @@ -1,38 +1,2 @@ - - - - - - - -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/init_container.sh b/2.3.3/init_container.sh index cb32295..39847a3 100644 --- a/2.3.3/init_container.sh +++ b/2.3.3/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.3/sshd_config b/2.3.3/sshd_config index a3690f2..7787ce7 100644 --- a/2.3.3/sshd_config +++ b/2.3.3/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.3.3/startup.sh b/2.3.3/startup.sh index 14d520a..795b27f 100644 --- a/2.3.3/startup.sh +++ b/2.3.3/startup.sh @@ -63,35 +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" 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.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 new file mode 100644 index 0000000..ca73184 --- /dev/null +++ b/2.3.8/Dockerfile @@ -0,0 +1,37 @@ +FROM appsvc/rubybase:2.3.8 +LABEL maintainer="Azure App Services Container Images " + +COPY init_container.sh /bin/ +COPY startup.sh /opt/ +COPY sshd_config /etc/ssh/ +COPY hostingstart.html /opt/startup/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.8 + +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.8/README.txt b/2.3.8/README.txt new file mode 100644 index 0000000..5c6c91f --- /dev/null +++ b/2.3.8/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.8/hostingstart.html b/2.3.8/hostingstart.html new file mode 100644 index 0000000..d55a3f6 --- /dev/null +++ b/2.3.8/hostingstart.html @@ -0,0 +1,2 @@ + +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/init_container.sh b/2.3.8/init_container.sh new file mode 100644 index 0000000..bd210bb --- /dev/null +++ b/2.3.8/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.8 +/opt/startup.sh "$@" + diff --git a/2.3.8/sshd_config b/2.3.8/sshd_config new file mode 100644 index 0000000..7787ce7 --- /dev/null +++ b/2.3.8/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.8/startup.sh b/2.3.8/startup.sh new file mode 100644 index 0000000..795b27f --- /dev/null +++ b/2.3.8/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.8/staticsite.rb b/2.3.8/staticsite.rb new file mode 100644 index 0000000..34814f7 --- /dev/null +++ b/2.3.8/staticsite.rb @@ -0,0 +1,7 @@ +require 'webrick' +options = { + :Port => ENV["PORT"].to_i, + :DirectoryIndex => ["hostingstart.html"], + :DocumentRoot => '/opt/startup' +} +WEBrick::HTTPServer.new(options).start diff --git a/2.4.5/Dockerfile b/2.4.5/Dockerfile new file mode 100644 index 0000000..9105026 --- /dev/null +++ b/2.4.5/Dockerfile @@ -0,0 +1,37 @@ +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 /opt/startup/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 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.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..d55a3f6 --- /dev/null +++ b/2.4.5/hostingstart.html @@ -0,0 +1,2 @@ + +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/init_container.sh b/2.4.5/init_container.sh new file mode 100644 index 0000000..008240f --- /dev/null +++ b/2.4.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.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..7787ce7 --- /dev/null +++ b/2.4.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.4.5/startup.sh b/2.4.5/startup.sh new file mode 100644 index 0000000..795b27f --- /dev/null +++ b/2.4.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.4.5/staticsite.rb b/2.4.5/staticsite.rb new file mode 100644 index 0000000..34814f7 --- /dev/null +++ b/2.4.5/staticsite.rb @@ -0,0 +1,7 @@ +require 'webrick' +options = { + :Port => ENV["PORT"].to_i, + :DirectoryIndex => ["hostingstart.html"], + :DocumentRoot => '/opt/startup' +} +WEBrick::HTTPServer.new(options).start diff --git a/2.5.5/Dockerfile b/2.5.5/Dockerfile new file mode 100644 index 0000000..8d52ff8 --- /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 /opt/startup/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..d55a3f6 --- /dev/null +++ b/2.5.5/hostingstart.html @@ -0,0 +1,2 @@ + +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/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..34814f7 --- /dev/null +++ b/2.5.5/staticsite.rb @@ -0,0 +1,7 @@ +require 'webrick' +options = { + :Port => ENV["PORT"].to_i, + :DirectoryIndex => ["hostingstart.html"], + :DocumentRoot => '/opt/startup' +} +WEBrick::HTTPServer.new(options).start diff --git a/2.6.2/Dockerfile b/2.6.2/Dockerfile new file mode 100644 index 0000000..04e9c92 --- /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 /opt/startup/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..d55a3f6 --- /dev/null +++ b/2.6.2/hostingstart.html @@ -0,0 +1,2 @@ + +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/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..34814f7 --- /dev/null +++ b/2.6.2/staticsite.rb @@ -0,0 +1,7 @@ +require 'webrick' +options = { + :Port => ENV["PORT"].to_i, + :DirectoryIndex => ["hostingstart.html"], + :DocumentRoot => '/opt/startup' +} +WEBrick::HTTPServer.new(options).start diff --git a/base_images/2.3.3/Dockerfile b/base_images/2.3.3/Dockerfile index 13eb25f..71da404 100644 --- a/base_images/2.3.3/Dockerfile +++ b/base_images/2.3.3/Dockerfile @@ -1,6 +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 new file mode 100644 index 0000000..0320394 --- /dev/null +++ b/base_images/2.3.8/Dockerfile @@ -0,0 +1,61 @@ +FROM buildpack-deps:jessie-curl +LABEL maintainer="Azure App Services Container Images " + +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 +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.8 +ENV RUBY_CONFIGURE_OPTS=--disable-install-doc + +ENV RUBY_CFLAGS=-O3 + +RUN eval "$(rbenv init -)" \ + && export WEBSITES_LATEST_NODE_VERSION="2.3.8" \ + && 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.4.5/Dockerfile b/base_images/2.4.5/Dockerfile new file mode 100644 index 0000000..17b8a8b --- /dev/null +++ b/base_images/2.4.5/Dockerfile @@ -0,0 +1,61 @@ +FROM buildpack-deps:jessie-curl +LABEL maintainer="Azure App Services Container Images " + +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 +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 diff --git a/base_images/2.5.5/Dockerfile b/base_images/2.5.5/Dockerfile new file mode 100644 index 0000000..09d3c74 --- /dev/null +++ b/base_images/2.5.5/Dockerfile @@ -0,0 +1,61 @@ +FROM buildpack-deps:jessie-curl +LABEL maintainer="Azure App Services Container Images " + +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 +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..afb02c2 --- /dev/null +++ b/base_images/2.6.2/Dockerfile @@ -0,0 +1,61 @@ +FROM buildpack-deps:jessie-curl +LABEL maintainer="Azure App Services Container Images " + +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 +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 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 diff --git a/pull_request_template.md b/pull_request_template.md new file mode 100644 index 0000000..a468a6d --- /dev/null +++ b/pull_request_template.md @@ -0,0 +1,5 @@ + + +--------------------------- +* [ ] 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)