Public | Automated Build

Last pushed: 14 days ago
Short Description
Docker image for ownCloud community edition
Full Description

ownCloud: Server

This is the official ownCloud image for the community edition, it is built from our base container. This ownCloud image is designed to work with a data volume in the host filesystem and with separate MariaDB and Redis containers.

Versions

To get an overview about the available versions please take a look at the GitHub branches or our Docker Hub tags, these lists are always up to date. Please note that release candidates or alpha/beta versions are only temporary available, they will be removed after the final release of a version.

Volumes

  • /mnt/data

Ports

  • 80
  • 443

Available environment variables


Inherited environment variables

Build locally

The available versions should be already pushed to the Docker Hub, but in case you want to try a change locally you can always execute the following command (run from a cloned GitHub repository) to get an image built locally:

source .env
IMAGE_NAME=owncloud/server:${VERSION} ./hooks/build

Launch with plain docker

The installation of docker is not covered by this instructions, please follow the official installation instructions. After the installation of docker you can continue with the required MariaDB and Redis containers:

docker run -d \
  --name redis \
  webhippie/redis:latest

docker run -d \
  --name mariadb \
  -e MARIADB_ROOT_PASSWORD=owncloud \
  -e MARIADB_USERNAME=owncloud \
  -e MARIADB_PASSWORD=owncloud \
  -e MARIADB_DATABASE=owncloud \
  --volume $(pwd)/mysql:/var/lib/mysql \
  webhippie/mariadb:latest

Then you can start the ownCloud web server, you can customize the used environment variables as needed, for the ownCloud version you can choose any of the available tags:

export OWNCLOUD_VERSION=10.0
export OWNCLOUD_DOMAIN=localhost
export OWNCLOUD_ADMIN_USERNAME=admin
export OWNCLOUD_ADMIN_PASSWORD=admin
export OWNCLOUD_HTTP_PORT=80
export OWNCLOUD_HTTPS_PORT=443

docker run -d \
  --name owncloud \
  --link mariadb:db \
  --link redis:redis \
  -p 80:80 \
  -p 443:443 \
  -e OWNCLOUD_DOMAIN=${OWNCLOUD_DOMAIN} \
  -e OWNCLOUD_DB_TYPE=mysql \
  -e OWNCLOUD_DB_NAME=owncloud \
  -e OWNCLOUD_DB_USERNAME=owncloud \
  -e OWNCLOUD_DB_PASSWORD=owncloud \
  -e OWNCLOUD_DB_HOST=db \
  -e OWNCLOUD_ADMIN_USERNAME=${OWNCLOUD_ADMIN_USERNAME} \
  -e OWNCLOUD_ADMIN_PASSWORD=${OWNCLOUD_ADMIN_PASSWORD} \
  -e OWNCLOUD_REDIS_ENABLED=true \
  -e OWNCLOUD_REDIS_HOST=redis \
  --volume $(pwd)/data:/mnt/data \
  owncloud/server:${OWNCLOUD_VERSION}

Launch with docker-compose

The installation of docker-compose is not covered by these instructions, please follow the official installation instructions. After the installation of docker-compose you can continue with the following commands to start the ownCloud stack. First we are defining some required environment variables, then we are downloading the required docker-compose.yml file. The .env and docker-compose.yml are expected in the current working directory, when running docker-compose commands, for the ownCloud version you can choose any of the available tags:

cat << EOF > .env
VERSION=10.0
DOMAIN=localhost
ADMIN_USERNAME=admin
ADMIN_PASSWORD=admin
HTTP_PORT=80
HTTPS_PORT=443
EOF

wget -O docker-compose.yml https://raw.githubusercontent.com/owncloud-docker/server/master/docker-compose.yml

# Finally start the containers in the background
docker-compose up -d

More commands of interest (try adding -h for help):

docker-compose exec owncloud bash
docker-compose stop
docker-compose start
docker-compose down
docker-compose logs

By default docker-compose up will start Redis, MariaDB and ownCloud containers, the ./data and ./mysql directories are used to store the contents persistently. The container ports 80 and 443 are bound as configured in the .env file.

Commandline commands

You can run occ commands inside the ownCloud docker image, without caring for sudo and apache user, as the command is wrapped in a little script caring for that. Just run:

occ user:report

You can also run commands via docker exec, or docker-compse exec:

docker exec -ti example_owncloud_1 occ user:report
docker-compose exec owncloud occ user:report

Upgrade to newer version

In order to upgrade an existing container-based installation you just need to shutdown the setup and replace the used container version. While booting the containers the upgrade process gets automatically triggered, so you don't need to perform any other manual step.

Custom apps

Installed apps or config.php changes inside the docker container are retained across stop/start as long as you keep the volumes configured.

Custom certificates

By default we generate self-signed certificates on startup of the containers, you can replace the certificates with your own certificates. Place them into ./data/certs/ssl-cert.crt and ./data/certs/ssl-cert.key.

Accessing the ownCloud

By default you can access the ownCloud instance at https://localhost/ as long as you have not changed the port binding. The initial user gets set by the environment variables ADMIN_USERNAME and ADMIN_PASSWORD, per default it's set to admin for username and password.

Issues, Feedback and Ideas

Open an Issue

Contributing

Fork -> Patch -> Push -> Pull Request

Authors

License

MIT

Copyright

Copyright (c) 2017 Thomas Boerger <tboerger@owncloud.com>
Docker Pull Command
Owner
owncloud
Source Repository