This repository has been archived by the owner on Feb 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
114 lines (88 loc) · 4.19 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
FROM buildpack-deps:jessie-curl
LABEL maintainer="Azure App Services Container Images <appsvc-images@microsoft.com>"
ENV RUBY_VERSION=${version}
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 --no-install-recommends libreadline-dev bzip2 build-essential libssl-dev zlib1g-dev libpq-dev \
libsqlite3-dev 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 wget git net-tools dnsutils curl tcpdump iproute2
# rbenv
ENV RBENV_ROOT="/usr/local/.rbenv"
RUN git clone https://github.com/rbenv/rbenv.git $RBENV_ROOT
RUN chmod -R 777 $RBENV_ROOT
ENV PATH="$RBENV_ROOT/bin:/usr/local:$PATH"
RUN git clone https://github.com/rbenv/ruby-build.git $RBENV_ROOT/plugins/ruby-build
RUN chmod -R 777 $RBENV_ROOT/plugins/ruby-build
RUN $RBENV_ROOT/plugins/ruby-build/install.sh
# Install ruby
ENV RUBY_CONFIGURE_OPTS=--disable-install-doc
ENV RUBY_CFLAGS=-O3
RUN cd $RBENV_ROOT \
&& git pull
RUN eval "$(rbenv init -)" \
&& rbenv install --force $RUBY_VERSION \
&& rbenv rehash \
&& rbenv global $RUBY_VERSION \
&& ls /usr/local -a \
&& gem install bundler --version "=1.13.6" \
&& chmod -R 777 $RBENV_ROOT/versions \
&& chmod -R 777 $RBENV_ROOT/version
RUN eval "$(rbenv init -)" \
&& rbenv global $RUBY_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
# find latest version of FreeTDS ftp://ftp.freetds.org/pub/freetds/stable/
ENV FREETDS_VERSION=1.1.6
RUN wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-$FREETDS_VERSION.tar.gz \
&& tar -xzf freetds-$FREETDS_VERSION.tar.gz \
&& rm freetds-$FREETDS_VERSION.tar.gz \
&& cd freetds-$FREETDS_VERSION \
&& ./configure --prefix=/usr/local --with-tdsver=7.3 \
&& make \
&& make install \
&& cd ..
# Make temp directory for ruby images
RUN mkdir -p /tmp/bundle
RUN chmod 777 /tmp/bundle
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" >> /root/.bashrc
RUN eval "$(rbenv init -)" \
&& rbenv global $RUBY_VERSION
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, and libssl1.1
RUN wget http://ftp.us.debian.org/debian/pool/main/o/openssl1.0/libssl1.0.2_1.0.2s-1~deb9u1_amd64.deb \
&& dpkg -i libssl1.0.2_1.0.2s-1~deb9u1_amd64.deb \
&& wget http://http.us.debian.org/debian/pool/main/g/glibc/libc6-udeb_2.29-2_amd64.udeb \
&& dpkg -i libc6-udeb_2.29-2_amd64.udeb \
&& wget http://ftp.us.debian.org/debian/pool/main/o/openssl/libcrypto1.1-udeb_1.1.0k-1~deb9u1_amd64.udeb \
&& dpkg -i --force-overwrite libcrypto1.1-udeb_1.1.0k-1~deb9u1_amd64.udeb \
&& wget http://ftp.us.debian.org/debian/pool/main/o/openssl/libssl1.1-udeb_1.1.0k-1~deb9u1_amd64.udeb \
&& dpkg -i --force-overwrite libssl1.1-udeb_1.1.0k-1~deb9u1_amd64.udeb
WORKDIR /home/site/wwwroot
ENTRYPOINT [ "/bin/init_container.sh" ]