Skip to content

Instantly share code, notes, and snippets.

@sky-joker
Last active Aug 15, 2019
Embed
What would you like to do?
owncloudを動かすコンテナのDockerfile
FROM centos:7
MAINTAINER sky-joker
RUN yum -y install gcc \
gcc-c++ \
mariadb \
mariadb-devel \
httpd httpd-devel \
libxml2-devel \
libcurl-devel \
libpng-devel \
libicu-devel \
openldap-devel.i686 \
bzip2 \
make \
openssh-server
RUN curl https://bootstrap.pypa.io/get-pip.py | python
RUN pip install pyOpenSSL
RUN mkdir /root/.ssh
ADD authorized_keys /root/.ssh
ADD https://www.php.net/distributions/php-7.2.21.tar.gz /tmp
RUN cd /tmp && \
tar zxf php-7.2.21.tar.gz && \
cd php-7.2.21 && \
./configure \
--enable-mbstring \
--enable-zip \
--enable-intl \
--with-gd \
--with-zlib \
--with-curl \
--with-apxs2=/usr/bin/apxs \
--with-mysqli \
--with-pdo-mysql \
--with-ldap && \
make && \
make install
ADD https://download.owncloud.org/community/owncloud-10.2.1.tar.bz2 /var/www/html
RUN cd /var/www/html && \
tar jxf owncloud-10.2.1.tar.bz2 && \
rm -f owncloud-10.2.1.tar.bz2 && \
chown apache.apache -R owncloud/
RUN echo "AddType application/x-httpd-php .php" > /etc/httpd/conf.d/php.conf && \
echo "DirectoryIndex index.php" >> /etc/httpd/conf.d/php.conf
RUN ssh-keygen -A
ADD startup.sh /opt
RUN chmod +x /opt/startup.sh
CMD /opt/startup.sh
#!/usr/bin/bash
/usr/bin/rm -f /var/run/httpd/httpd.pid
/usr/bin/rm -f /var/run/sshd.pid
/usr/sbin/sshd -D &
/usr/sbin/httpd -DFOREGROUND
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment