Commit a362e321 authored by Michiel de Jong's avatar Michiel de Jong

owncloud -> owncloud-git

parent c06b7a57
......@@ -7,7 +7,7 @@ RUN apt-get update \
pwgen \
&& rm -rf /var/lib/apt/lists/*
RUN curl -L
RUN cd /init && curl -L
COPY init/ /init/
COPY init/config.ini /init/config.ini
$VERSION = 0.6.5
echo "Extracting Known {$VERSION}..."
echo "Extracting Known $(VERSION}..."
cd /data/www-content
tar xzf /known-$VERSION.tgz
tar xzf /init/known-$VERSION.tgz
echo "Setting default config..."
cp /init/config.ini .
FROM indiehosters/lamp-git
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get -yq install \
bzip2 \
pwgen \
&& rm -rf /var/lib/apt/lists/*
RUN cd /init && curl -O
COPY init/ /init/
COPY init/config.php /init/config.php
# owncloud-git
This image adds ownCloud to the lamp-git image:
sudo docker build -t indiehosters/owncloud-git .
sudo docker run -it -v $(pwd)/data:/data -p 80:80 indiehosters/owncloud-git /bin/bash
And inside:
sh / &
sh /init/
sh /init/
Now you don't need this specific image anymore, but can run your instance with the generic lamp-git image:
sudo docker build -t indiehosters/lamp-git .
sudo docker run -it -v $(pwd)/data:/data -p 80:80 indiehosters/lamp-git /bin/bash
echo "Extracting ownCloud ${VERSION}..."
cd /data
tar xjf /init/owncloud-$VERSION.tar.bz2
rm -rf www-content
mv owncloud www-content
echo "Setting default config..."
cp /init/config.php ./www-content
chown -R root:www-data /data/www-content
chmod -R g+w /data/www-content
echo "Creating empty database..."
echo "CREATE DATABASE IF NOT EXISTS owncloud" | mysql
PWD=`pwgen 40 1`
echo "user: " > /data/login.txt
echo "pass: $PWD" >> /data/login.txt
echo "Please use your browser to set up a user, and edit /data/login.txt manually:"
cat /data/login.txt
FROM indiehosters/lamp
# Download latest version of ownCloud into /app
RUN apt-get update && \
apt-get -yq install \
bzip2 && \
curl -L \
| tar xj && \
mv owncloud/* app && \
apt-get -yq remove bzip2 && \
apt-get -yq autoclean && \
rm -rf /var/lib/apt/lists/*
ADD oc-config.php /app/oc-config.php
# Add script to create 'owncloud' DB
RUN chmod 755 /
RUN chmod -R 775 /app/config
# Expose environment variables
ENV DB_HOST **LinkMe**
ENV DB_PORT **LinkMe**
ENV DB_NAME owncloud
ENV DB_PASS **ChangeMe**
VOLUME ["/app"]
CMD ["/"]
# Work in progress
This image doesn't work yet, still needs some permissions tweaking and such.
# Usage:
PASS=`pwgen 20 1`
sudo docker pull debian:jessie
sudo docker build -t indiehosters/lamp ../lamp
sudo docker build -t indiehosters/owncloud .
sudo docker run -d -e MYSQL_PASS=$PASS --name mysql indiehosters/mysql
sudo docker run -d -p 80:80 --link mysql:db -e DB_PASS=$PASS indiehosters/owncloud
echo Using $PASS as the database password. Waiting for everything to be up...
sleep 20
curl -I http://localhost/
* The base configurations of the WordPress.
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link Editing
* oc-config.php} Codex page. You can get the MySQL settings from your web host.
* This file is used by the oc-config.php creation script during the
* installation. You don't have to use the web site, you can just copy this file
* to "oc-config.php" and fill in the values.
* @package WordPress
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', getenv('DB_NAME'));
/** MySQL database username */
define('DB_USER', getenv('DB_USER'));
/** MySQL database password */
define('DB_PASSWORD', getenv('DB_PASS'));
/** MySQL hostname */
define('DB_HOST', getenv('DB_HOST').":".getenv('DB_PORT'));
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
* Authentication Unique Keys and Salts.
* Change these to different unique phrases!
* You can generate these using the {@link secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
* @since 2.6.0
define('AUTH_KEY', '--w,=nO-t>g:EOH>e-ZXs!7x(: W4:}1A2$E?Sn9P>TW-[=:u[nc-eQ<vIi<6|wh');
define('SECURE_AUTH_KEY', 'PlM~WQ/9-~V:-3&be`nxuaghz@JyN!]SzVr_]lAM2b?QH(d(|`.z_;1jIE4kY&f+');
define('LOGGED_IN_KEY', 'K]6*uCb-m~>zj5C1krtu:>2VT(WlI/Jl5T~Pov2-`r+Zb5s3i6&aIN$*/+k/~sLN');
define('NONCE_KEY', '~; xvP`h^{Pl9zaD#/!f@M21BAk0#sKg>*P+=1LV+FY+;HNE)%Y`4(Xq|&})fCj^');
define('AUTH_SALT', 'A2|G[jvSLB+z dy S/ S>(lLyzxDvJ8(ps1(F%~x]eRD`UHv(h*IDjye+SYV-a;O');
define('SECURE_AUTH_SALT', '9cv/Hy~a;qr]4)i*udy-/$non@_:CU0SIdm-L[WH^k_}s:Jq[)HV,Wu8na<_;ef3');
define('LOGGED_IN_SALT', '{d*4OCrk9x`|cb-4EBK7=ewJ3D]y%z,7mSEd:8?=eP![zD.O`<Uubt-u%@TA+x T');
define('NONCE_SALT', 'z6G5thFC]JIW]|ZQIBgZ?zBb^!N#3-Un=)`!Xb/,Yd8[2&}.W{ITu?=PE0oZ,<8^');
* WordPress Database Table prefix.
* You can have multiple installations in one database if you give each a unique
* prefix. Only numbers, letters, and underscores please!
$table_prefix = 'oc_';
* WordPress Localized Language, defaults to English.
* Change this to localize WordPress. A corresponding MO file for the chosen
* language must be installed to oc-content/languages. For example, install
* to oc-content/languages and set OCLANG to 'de_DE' to enable German
* language support.
define('OCLANG', '');
* For developers: WordPress debugging mode.
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use OC_DEBUG
* in their development environments.
define('OC_DEBUG', false);
/* That's all, stop editing! Happy blogging. */
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'oc-settings.php');
/** change permisssions for plugin installation */
define("FS_CHMOD_DIR", 0777);
define("FS_CHMOD_FILE", 0777);
chown -R root:www-data /app
chmod -R 650 /app
chmod -R 770 /app/oc-content/
chmod -R 660 /app/.htaccess
if [ -f /.mysql_db_created ]; then
exec /
exit 1
if [ "$DB_PASS" = "**ChangeMe**" ] && [ -n "$DB_1_ENV_MYSQL_PASS" ]; then
echo "=> Trying to connect to MySQL/MariaDB using:"
echo "========================================================================"
echo " Database Host Address: $DB_HOST"
echo " Database Port number: $DB_PORT"
echo " Database Name: $DB_NAME"
echo " Database Username: $DB_USER"
echo " Database Password: $DB_PASS"
echo "========================================================================"
for ((i=0;i<10;i++))
DB_CONNECTABLE=$(mysql -u$DB_USER -p$DB_PASS -h$DB_HOST -P$DB_PORT -e 'status' >/dev/null 2>&1; echo "$?")
if [[ DB_CONNECTABLE -eq 0 ]]; then
sleep 5
if [[ $DB_CONNECTABLE -eq 0 ]]; then
DB_EXISTS=$(mysql -u$DB_USER -p$DB_PASS -h$DB_HOST -P$DB_PORT -e "SHOW DATABASES LIKE '"$DB_NAME"';" 2>&1 |grep "$DB_NAME" > /dev/null ; echo "$?")
if [[ DB_EXISTS -eq 1 ]]; then
echo "=> Creating database $DB_NAME"
if [[ RET -ne 0 ]]; then
echo "Cannot create database for owncloud"
exit RET
if [ -f /initial_db.sql ]; then
echo "=> Loading initial database data to $DB_NAME"
RET=$(mysql -u$DB_USER -p$DB_PASS -h$DB_HOST -P$DB_PORT $DB_NAME < /initial_db.sql)
if [[ RET -ne 0 ]]; then
echo "Cannot load initial database data for owncloud"
exit RET
echo "=> Done!"
echo "=> Skipped creation of database $DB_NAME – it already exists."
echo "Cannot connect to Mysql"
touch /.mysql_db_created
exec /
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment