Giter Site home page Giter Site logo

nextcloud / docker Goto Github PK

View Code? Open in Web Editor NEW
5.6K 135.0 1.8K 1.59 MB

⛴ Docker image of Nextcloud

Home Page: https://hub.docker.com/_/nextcloud/

License: GNU Affero General Public License v3.0

Shell 47.76% PHP 31.75% Dockerfile 20.49%
nextcloud docker open-source docker-image

docker's Introduction

What is Nextcloud?

GitHub CI build status badge update.sh build status badge amd64 build status badge arm32v5 build status badge arm32v6 build status badge arm32v7 build status badge arm64v8 build status badge i386 build status badge mips64le build status badge ppc64le build status badge s390x build status badge

A safe home for all your data. Access & share your files, calendars, contacts, mail & more from any device, on your terms.

logo

⚠️⚠️⚠️ This image is maintained by community volunteers and designed for expert use. For quick and easy deployment that supports the full set of Nextcloud Hub features, use the Nextcloud All-in-One docker container maintained by Nextcloud GmbH.

How to use this image

This image is designed to be used in a micro-service environment. There are two versions of the image you can choose from.

The apache tag contains a full Nextcloud installation including an apache web server. It is designed to be easy to use and gets you running pretty fast. This is also the default for the latest tag and version tags that are not further specified.

The second option is a fpm container. It is based on the php-fpm image and runs a fastCGI-Process that serves your Nextcloud page. To use this image it must be combined with any webserver that can proxy the http requests to the FastCGI-port of the container.

Try in PWD

Using the apache image

The apache image contains a webserver and exposes port 80. To start the container type:

$ docker run -d -p 8080:80 nextcloud

Now you can access Nextcloud at http://localhost:8080/ from your host system.

Using the fpm image

To use the fpm image, you need an additional web server, such as nginx, that can proxy http-request to the fpm-port of the container. For fpm connection this container exposes port 9000. In most cases, you might want to use another container or your host as proxy. If you use your host you can address your Nextcloud container directly on port 9000. If you use another container, make sure that you add them to the same docker network (via docker run --network <NAME> ... or a docker-compose file). In both cases you don't want to map the fpm port to your host.

$ docker run -d nextcloud:fpm

As the fastCGI-Process is not capable of serving static files (style sheets, images, ...), the webserver needs access to these files. This can be achieved with the volumes-from option. You can find more information in the docker-compose section.

Using an external database

By default, this container uses SQLite for data storage but the Nextcloud setup wizard (appears on first run) allows connecting to an existing MySQL/MariaDB or PostgreSQL database. You can also link a database container, e. g. --link my-mysql:mysql, and then use mysql as the database host on setup. More info is in the docker-compose section.

Persistent data

The Nextcloud installation and all data beyond what lives in the database (file uploads, etc.) are stored in the unnamed docker volume volume /var/www/html. The docker daemon will store that data within the docker directory /var/lib/docker/volumes/.... That means your data is saved even if the container crashes, is stopped or deleted.

A named Docker volume or a mounted host directory should be used for upgrades and backups. To achieve this, you need one volume for your database container and one for Nextcloud.

Nextcloud:

  • /var/www/html/ folder where all Nextcloud data lives
$ docker run -d \
-v nextcloud:/var/www/html \
nextcloud

Database:

  • /var/lib/mysql MySQL / MariaDB Data
  • /var/lib/postgresql/data PostgreSQL Data
$ docker run -d \
-v db:/var/lib/mysql \
mariadb:10.6

Additional volumes

If you want to get fine grained access to your individual files, you can mount additional volumes for data, config, your theme and custom apps. The data, config files are stored in respective subfolders inside /var/www/html/. The apps are split into core apps (which are shipped with Nextcloud and you don't need to take care of) and a custom_apps folder. If you use a custom theme it would go into the themes subfolder.

Overview of the folders that can be mounted as volumes:

  • /var/www/html Main folder, needed for updating
  • /var/www/html/custom_apps installed / modified apps
  • /var/www/html/config local configuration
  • /var/www/html/data the actual data of your Nextcloud
  • /var/www/html/themes/<YOUR_CUSTOM_THEME> theming/branding

If you want to use named volumes for all of these, it would look like this:

$ docker run -d \
-v nextcloud:/var/www/html \
-v apps:/var/www/html/custom_apps \
-v config:/var/www/html/config \
-v data:/var/www/html/data \
-v theme:/var/www/html/themes/<YOUR_CUSTOM_THEME> \
nextcloud

Custom volumes

If mounting additional volumes under /var/www/html, you should consider:

  • Confirming that upgrade.exclude contains the files and folders that should persist during installation and upgrades; or
  • Mounting storage volumes to locations outside of /var/www/html.

Warning

You should note that data inside the main folder (/var/www/html) will be overridden/removed during installation and upgrades, unless listed in upgrade.exclude. The additional volumes officially supported are already in that list, but custom volumes will need to be added by you. We suggest mounting custom storage volumes outside of /var/www/html and if possible read-only so that making this adjustment is unnecessary. If you must do so, however, you may build a custom image with a modified /upgrade.exclude file that incorporates your custom volume(s).

Using the Nextcloud command-line interface

To use the Nextcloud command-line interface (aka. occ command):

$ docker exec --user www-data CONTAINER_ID php occ

or for docker-compose:

$ docker-compose exec --user www-data app php occ

Auto configuration via environment variables

The Nextcloud image supports auto configuration via environment variables. You can preconfigure everything that is asked on the install page on first run. To enable auto configuration, set your database connection via the following environment variables. You must specify all of the environment variables for a given database or the database environment variables defaults to SQLITE. ONLY use one database type!

SQLite:

  • SQLITE_DATABASE Name of the database using sqlite

MYSQL/MariaDB:

  • MYSQL_DATABASE Name of the database using mysql / mariadb.
  • MYSQL_USER Username for the database using mysql / mariadb.
  • MYSQL_PASSWORD Password for the database user using mysql / mariadb.
  • MYSQL_HOST Hostname of the database server using mysql / mariadb.

PostgreSQL:

  • POSTGRES_DB Name of the database using postgres.
  • POSTGRES_USER Username for the database using postgres.
  • POSTGRES_PASSWORD Password for the database user using postgres.
  • POSTGRES_HOST Hostname of the database server using postgres.

As an alternative to passing sensitive information via environment variables, _FILE may be appended to the previously listed environment variables, causing the initialization script to load the values for those variables from files present in the container. See Docker secrets section below.

If you set any group of values (i.e. all of MYSQL_DATABASE, MYSQL_USER, MYSQL_PASSWORD, MYSQL_HOST), they will not be asked in the install page on first run. With a complete configuration by using all variables for your database type, you can additionally configure your Nextcloud instance by setting admin user and password (only works if you set both):

  • NEXTCLOUD_ADMIN_USER Name of the Nextcloud admin user.
  • NEXTCLOUD_ADMIN_PASSWORD Password for the Nextcloud admin user.

If you want, you can set the data directory, otherwise default value will be used.

  • NEXTCLOUD_DATA_DIR (default: /var/www/html/data) Configures the data directory where nextcloud stores all files from the users.

One or more trusted domains can be set through environment variable, too. They will be added to the configuration after install.

  • NEXTCLOUD_TRUSTED_DOMAINS (not set by default) Optional space-separated list of domains

The install and update script is only triggered when a default command is used (apache-foreground or php-fpm). If you use a custom command you have to enable the install / update with

  • NEXTCLOUD_UPDATE (default: 0)

You might want to make sure the htaccess is up to date after each container update. Especially on multiple swarm nodes as any discrepancy will make your server unusable.

  • NEXTCLOUD_INIT_HTACCESS (not set by default) Set it to true to enable run occ maintenance:update:htaccess after container initialization.

If you want to use Redis you have to create a separate Redis container in your setup / in your docker-compose file. To inform Nextcloud about the Redis container, pass in the following parameters:

  • REDIS_HOST (not set by default) Name of Redis container
  • REDIS_HOST_PORT (default: 6379) Optional port for Redis, only use for external Redis servers that run on non-standard ports.
  • REDIS_HOST_PASSWORD (not set by default) Redis password

The use of Redis is recommended to prevent file locking problems. See the examples for further instructions.

To use an external SMTP server, you have to provide the connection details. To configure Nextcloud to use SMTP add:

  • SMTP_HOST (not set by default): The hostname of the SMTP server.
  • SMTP_SECURE (empty by default): Set to ssl to use SSL, or tls to use STARTTLS.
  • SMTP_PORT (default: 465 for SSL and 25 for non-secure connections): Optional port for the SMTP connection. Use 587 for an alternative port for STARTTLS.
  • SMTP_AUTHTYPE (default: LOGIN): The method used for authentication. Use PLAIN if no authentication is required.
  • SMTP_NAME (empty by default): The username for the authentication.
  • SMTP_PASSWORD (empty by default): The password for the authentication.
  • MAIL_FROM_ADDRESS (not set by default): Set the local-part for the 'from' field in the emails sent by Nextcloud.
  • MAIL_DOMAIN (not set by default): Set a different domain for the emails than the domain where Nextcloud is installed.

At least SMTP_HOST, MAIL_FROM_ADDRESS and MAIL_DOMAIN must be set for the configurations to be applied.

Check the Nextcloud documentation for other values to configure SMTP.

To use an external S3 compatible object store as primary storage, set the following variables:

  • OBJECTSTORE_S3_BUCKET: The name of the bucket that Nextcloud should store the data in
  • OBJECTSTORE_S3_REGION: The region that the S3 bucket resides in
  • OBJECTSTORE_S3_HOST: The hostname of the object storage server
  • OBJECTSTORE_S3_PORT: The port that the object storage server is being served over
  • OBJECTSTORE_S3_KEY: AWS style access key
  • OBJECTSTORE_S3_SECRET: AWS style secret access key
  • OBJECTSTORE_S3_STORAGE_CLASS: The storage class to use when adding objects to the bucket
  • OBJECTSTORE_S3_SSL (default: true): Whether or not SSL/TLS should be used to communicate with object storage server
  • OBJECTSTORE_S3_USEPATH_STYLE (default: false): Not required for AWS S3
  • OBJECTSTORE_S3_LEGACYAUTH (default: false): Not required for AWS S3
  • OBJECTSTORE_S3_OBJECT_PREFIX (default: urn:oid:): Prefix to prepend to the fileid
  • OBJECTSTORE_S3_AUTOCREATE (default: true): Create the container if it does not exist
  • OBJECTSTORE_S3_SSE_C_KEY (not set by default): Base64 encoded key with a maximum length of 32 bytes for server side encryption (SSE-C)

Check the Nextcloud documentation for more information.

To use an external OpenStack Swift object store as primary storage, set the following variables:

  • OBJECTSTORE_SWIFT_URL: The Swift identity (Keystone) endpoint
  • OBJECTSTORE_SWIFT_AUTOCREATE (default: false): Whether or not Nextcloud should automatically create the Swift container
  • OBJECTSTORE_SWIFT_USER_NAME: Swift username
  • OBJECTSTORE_SWIFT_USER_PASSWORD: Swift user password
  • OBJECTSTORE_SWIFT_USER_DOMAIN (default: Default): Swift user domain
  • OBJECTSTORE_SWIFT_PROJECT_NAME: OpenStack project name
  • OBJECTSTORE_SWIFT_PROJECT_DOMAIN (default: Default): OpenStack project domain
  • OBJECTSTORE_SWIFT_SERVICE_NAME (default: swift): Swift service name
  • OBJECTSTORE_SWIFT_REGION: Swift endpoint region
  • OBJECTSTORE_SWIFT_CONTAINER_NAME: Swift container (bucket) that Nextcloud should store the data in

Check the Nextcloud documentation for more information.

To customize other PHP limits you can simply change the following variables:

  • PHP_MEMORY_LIMIT (default 512M) This sets the maximum amount of memory in bytes that a script is allowed to allocate. This is meant to help prevent poorly written scripts from eating up all available memory but it can prevent normal operation if set too tight.
  • PHP_UPLOAD_LIMIT (default 512M) This sets the upload limit (post_max_size and upload_max_filesize) for big files. Note that you may have to change other limits depending on your client, webserver or operating system. Check the Nextcloud documentation for more information.

To customize Apache max file upload limit you can change the following variable:

  • APACHE_BODY_LIMIT (default 1073741824 [1GiB]) This restricts the total size of the HTTP request body sent from the client. It specifies the number of bytes that are allowed in a request body. A value of 0 means unlimited. Check the Nextcloud documentation for more information.

Auto configuration via hook folders

There are 5 hooks

  • pre-installation Executed before the Nextcloud is installed/initiated
  • post-installation Executed after the Nextcloud is installed/initiated
  • pre-upgrade Executed before the Nextcloud is upgraded
  • post-upgrade Executed after the Nextcloud is upgraded
  • before-starting Executed before the Nextcloud starts

To use the hooks triggered by the entrypoint script, either

  • Added your script(s) to the individual of the hook folder(s), which are located at the path /docker-entrypoint-hooks.d in the container
  • Use volume(s) if you want to use script from the host system inside the container, see example.

Note: Only the script(s) located in a hook folder (not sub-folders), ending with .sh and marked as executable, will be executed.

Example: Mount using volumes

...
  app:
    image: nextcloud:stable

    volumes:
      - ./app-hooks/pre-installation:/docker-entrypoint-hooks.d/pre-installation
      - ./app-hooks/post-installation:/docker-entrypoint-hooks.d/post-installation
      - ./app-hooks/pre-upgrade:/docker-entrypoint-hooks.d/pre-upgrade
      - ./app-hooks/post-upgrade:/docker-entrypoint-hooks.d/post-upgrade
      - ./app-hooks/before-starting:/docker-entrypoint-hooks.d/before-starting
...

Using the apache image behind a reverse proxy and auto configure server host and protocol

The apache image will replace the remote addr (IP address visible to Nextcloud) with the IP address from X-Real-IP if the request is coming from a proxy in 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16 by default. If you want Nextcloud to pick up the server host (HTTP_X_FORWARDED_HOST), protocol (HTTP_X_FORWARDED_PROTO) and client IP (HTTP_X_FORWARDED_FOR) from a trusted proxy, then disable rewrite IP and add the reverse proxy's IP address to TRUSTED_PROXIES.

  • APACHE_DISABLE_REWRITE_IP (not set by default): Set to 1 to disable rewrite IP.

  • TRUSTED_PROXIES (empty by default): A space-separated list of trusted proxies. CIDR notation is supported for IPv4.

If the TRUSTED_PROXIES approach does not work for you, try using fixed values for overwrite parameters.

  • OVERWRITEHOST (empty by default): Set the hostname of the proxy. Can also specify a port.
  • OVERWRITEPROTOCOL (empty by default): Set the protocol of the proxy, http or https.
  • OVERWRITECLIURL (empty by default): Set the cli url of the proxy (e.g. https://mydnsname.example.com)
  • OVERWRITEWEBROOT (empty by default): Set the absolute path of the proxy.
  • OVERWRITECONDADDR (empty by default): Regex to overwrite the values dependent on the remote address.

Check the Nexcloud documentation for more details.

Keep in mind that once set, removing these environment variables won't remove these values from the configuration file, due to how Nextcloud merges configuration files together.

Running this image with docker-compose

The easiest way to get a fully featured and functional setup is using a docker-compose file. There are too many different possibilities to setup your system, so here are only some examples of what you have to look for.

At first, make sure you have chosen the right base image (fpm or apache) and added features you wanted (see below). In every case, you would want to add a database container and docker volumes to get easy access to your persistent data. When you want to have your server reachable from the internet, adding HTTPS-encryption is mandatory! See below for more information.

Base version - apache

This version will use the apache image and add a mariaDB container. The volumes are set to keep your data persistent. This setup provides no ssl encryption and is intended to run behind a proxy.

Make sure to pass in values for MYSQL_ROOT_PASSWORD and MYSQL_PASSWORD variables before you run this setup.

version: '2'

volumes:
  nextcloud:
  db:

services:
  db:
    image: mariadb:10.6
    restart: always
    command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=
      - MYSQL_PASSWORD=
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    image: nextcloud
    restart: always
    ports:
      - 8080:80
    links:
      - db
    volumes:
      - nextcloud:/var/www/html
    environment:
      - MYSQL_PASSWORD=
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db

Then run docker-compose up -d, now you can access Nextcloud at http://localhost:8080/ from your host system.

Base version - FPM

When using the FPM image, you need another container that acts as web server on port 80 and proxies the requests to the Nextcloud container. In this example a simple nginx container is combined with the Nextcloud-fpm image and a MariaDB database container. The data is stored in docker volumes. The nginx container also needs access to static files from your Nextcloud installation. It gets access to all the volumes mounted to Nextcloud via the volumes_from option. The configuration for nginx is stored in the configuration file nginx.conf, that is mounted into the container. An example can be found in the examples section here.

As this setup does not include encryption, it should be run behind a proxy.

Make sure to pass in values for MYSQL_ROOT_PASSWORD and MYSQL_PASSWORD variables before you run this setup.

version: '2'

volumes:
  nextcloud:
  db:

services:
  db:
    image: mariadb:10.6
    restart: always
    command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=
      - MYSQL_PASSWORD=
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    image: nextcloud:fpm
    restart: always
    links:
      - db
    volumes:
      - nextcloud:/var/www/html
    environment:
      - MYSQL_PASSWORD=
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db

  web:
    image: nginx
    restart: always
    ports:
      - 8080:80
    links:
      - app
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    volumes_from:
      - app

Then run docker-compose up -d, now you can access Nextcloud at http://localhost:8080/ from your host system.

Docker Secrets

As an alternative to passing sensitive information via environment variables, _FILE may be appended to the previously listed environment variables, causing the initialization script to load the values for those variables from files present in the container. In particular, this can be used to load passwords from Docker secrets stored in /run/secrets/<secret_name> files. For example:

version: '3.2'

services:
  db:
    image: postgres
    restart: always
    volumes:
      - db:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB_FILE=/run/secrets/postgres_db
      - POSTGRES_USER_FILE=/run/secrets/postgres_user
      - POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password
    secrets:
      - postgres_db
      - postgres_password
      - postgres_user

  app:
    image: nextcloud
    restart: always
    ports:
      - 8080:80
    volumes:
      - nextcloud:/var/www/html
    environment:
      - POSTGRES_HOST=db
      - POSTGRES_DB_FILE=/run/secrets/postgres_db
      - POSTGRES_USER_FILE=/run/secrets/postgres_user
      - POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password
      - NEXTCLOUD_ADMIN_PASSWORD_FILE=/run/secrets/nextcloud_admin_password
      - NEXTCLOUD_ADMIN_USER_FILE=/run/secrets/nextcloud_admin_user
    depends_on:
      - db
    secrets:
      - nextcloud_admin_password
      - nextcloud_admin_user
      - postgres_db
      - postgres_password
      - postgres_user

volumes:
  db:
  nextcloud:

secrets:
  nextcloud_admin_password:
    file: ./nextcloud_admin_password.txt # put admin password in this file
  nextcloud_admin_user:
    file: ./nextcloud_admin_user.txt # put admin username in this file
  postgres_db:
    file: ./postgres_db.txt # put postgresql db name in this file
  postgres_password:
    file: ./postgres_password.txt # put postgresql password in this file
  postgres_user:
    file: ./postgres_user.txt # put postgresql username in this file

Currently, this is only supported for NEXTCLOUD_ADMIN_PASSWORD, NEXTCLOUD_ADMIN_USER, MYSQL_DATABASE, MYSQL_PASSWORD, MYSQL_USER, POSTGRES_DB, POSTGRES_PASSWORD, POSTGRES_USER, REDIS_HOST_PASSWORD, SMTP_PASSWORD, OBJECTSTORE_S3_KEY, and OBJECTSTORE_S3_SECRET.

If you set any group of values (i.e. all of MYSQL_DATABASE_FILE, MYSQL_USER_FILE, MYSQL_PASSWORD_FILE, MYSQL_HOST), the script will not use the corresponding group of environment variables (MYSQL_DATABASE, MYSQL_USER, MYSQL_PASSWORD, MYSQL_HOST).

Make your Nextcloud available from the internet

Until here, your Nextcloud is just available from your docker host. If you want your Nextcloud available from the internet adding SSL encryption is mandatory.

HTTPS - SSL encryption

There are many different possibilities to introduce encryption depending on your setup.

We recommend using a reverse proxy in front of your Nextcloud installation. Your Nextcloud will only be reachable through the proxy, which encrypts all traffic to the clients. You can mount your manually generated certificates to the proxy or use a fully automated solution which generates and renews the certificates for you.

In our examples section we have an example for a fully automated setup using a reverse proxy, a container for Let's Encrypt certificate handling, database and Nextcloud. It uses the popular nginx-proxy and docker-letsencrypt-nginx-proxy-companion containers. Please check the according documentations before using this setup.

First use

When you first access your Nextcloud, the setup wizard will appear and ask you to choose an administrator account username, password and the database connection. For the database use db as host and nextcloud as table and user name. Also enter the password you chose in your docker-compose.yml file.

Update to a newer version

Updating the Nextcloud container is done by pulling the new image, throwing away the old container and starting the new one.

It is only possible to upgrade one major version at a time. For example, if you want to upgrade from version 14 to 16, you will have to upgrade from version 14 to 15, then from 15 to 16.

Since all data is stored in volumes, nothing gets lost. The startup script will check for the version in your volume and the installed docker version. If it finds a mismatch, it automatically starts the upgrade process. Don't forget to add all the volumes to your new container, so it works as expected.

$ docker pull nextcloud
$ docker stop <your_nextcloud_container>
$ docker rm <your_nextcloud_container>
$ docker run <OPTIONS> -d nextcloud

Beware that you have to run the same command with the options that you used to initially start your Nextcloud. That includes volumes, port mapping.

When using docker-compose your compose file takes care of your configuration, so you just have to run:

$ docker-compose pull
$ docker-compose up -d

Adding Features

A lot of people want to use additional functionality inside their Nextcloud installation. If the image does not include the packages you need, you can easily build your own image on top of it. Start your derived image with the FROM statement and add whatever you like.

FROM nextcloud:apache

RUN ...

The examples folder gives a few examples on how to add certain functionalities, like including the cron job, smb-support or imap-authentication.

If you use your own Dockerfile, you need to configure your docker-compose file accordingly. Switch out the image option with build. You have to specify the path to your Dockerfile. (in the example it's in the same directory next to the docker-compose file)

  app:
    build: .
    restart: always
    links:
      - db
    volumes:
      - data:/var/www/html/data
      - config:/var/www/html/config
      - apps:/var/www/html/apps

If you intend to use another command to run the image, make sure that you set NEXTCLOUD_UPDATE=1 in your Dockerfile. Otherwise the installation and update will not work.

FROM nextcloud:apache

...

ENV NEXTCLOUD_UPDATE=1

CMD ["/usr/bin/supervisord"]

Updating your own derived image is also very simple. When a new version of the Nextcloud image is available run:

docker build -t your-name --pull .
docker run -d your-name

or for docker-compose:

docker-compose build --pull
docker-compose up -d

The --pull option tells docker to look for new versions of the base image. Then the build instructions inside your Dockerfile are run on top of the new image.

Migrating an existing installation

You're already using Nextcloud and want to switch to docker? Great! Here are some things to look out for:

  1. Define your whole Nextcloud infrastructure in a docker-compose file and run it with docker-compose up -d to get the base installation, volumes and database. Work from there.
  2. Restore your database from a mysqldump (nextcloud_db_1 is the name of your db container)
    • To import from a MySQL dump use the following commands
    docker cp ./database.dmp nextcloud_db_1:/dmp
    docker-compose exec db sh -c "mysql --user USER --password PASSWORD nextcloud < /dmp"
    docker-compose exec db rm /dmp
    • To import from a PostgreSQL dump use to following commands
    docker cp ./database.dmp nextcloud_db_1:/dmp
    docker-compose exec db sh -c "psql -U USER --set ON_ERROR_STOP=on nextcloud < /dmp"
    docker-compose exec db rm /dmp
  3. Edit your config.php
    1. Set database connection
      • In case of MySQL database
      'dbhost' => 'db:3306',
      • In case of PostgreSQL database
      'dbhost' => 'db:5432',
    2. Make sure you have no configuration for the apps_paths. Delete lines like these
      'apps_paths' => array (
          0 => array (
              'path' => OC::$SERVERROOT.'/apps',
              'url' => '/apps',
              'writable' => true,
          ),
      ),
    3. Make sure to have the apps directory non writable and the custom_apps directory writable
      'apps_paths' => array (
        0 => array (
          'path' => '/var/www/html/apps',
          'url' => '/apps',
          'writable' => false,
        ),
        1 => array (
          'path' => '/var/www/html/custom_apps',
          'url' => '/custom_apps',
          'writable' => true,
        ),
      ),
    4. Make sure your data directory is set to /var/www/html/data
      'datadirectory' => '/var/www/html/data',
  4. Copy your data (nextcloud_app_1 is the name of your Nextcloud container):
    docker cp ./data/ nextcloud_app_1:/var/www/html/
    docker-compose exec app chown -R www-data:www-data /var/www/html/data
    docker cp ./theming/ nextcloud_app_1:/var/www/html/
    docker-compose exec app chown -R www-data:www-data /var/www/html/theming
    docker cp ./config/config.php nextcloud_app_1:/var/www/html/config
    docker-compose exec app chown -R www-data:www-data /var/www/html/config
    If you want to preserve the metadata of your files like timestamps, copy the data directly on the host to the named volume using plain cp like this:
    cp --preserve --recursive ./data/ /path/to/nextcloudVolume/data
  5. Copy only the custom apps you use (or simply redownload them from the web interface):
    docker cp ./custom_apps/ nextcloud_data:/var/www/html/
    docker-compose exec app chown -R www-data:www-data /var/www/html/custom_apps

Questions / Issues

If you got any questions or problems using the image, please visit our Github Repository and write an issue.

docker's People

Contributors

am97 avatar bleuzen avatar cropse avatar docker-library-bot avatar ffried avatar greek64 avatar j0wi avatar joshtrichards avatar kesselb avatar mabeett avatar marceljd avatar meonkeys avatar pbek avatar pierreozoux avatar remram44 avatar rodrigoaguilera avatar rubo77 avatar rugk avatar schroedingers-cat avatar skjnldsv avatar snowmb avatar st3iny avatar stunkymonkey avatar szaimen avatar thomas131 avatar tianon avatar tilosp avatar tilosp-bot avatar tobru avatar vfreex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker's Issues

Don't overwrite/delete /var/www/html/themes folder

Hey,

at the moment, in the /entrypoint.sh is the following line:
rsync -a --delete --exclude /config/ --exclude /data/ --exclude /custom_apps/ /usr/src/nextcloud/ /var/www/html/

Please exclude also the themes directory. We have mounted our theme from the host in /var/www/html/themes. After a pull of the images, a new version was available and the hole folder /var/www/html/themes were deleted and replaced with only the example-folder from the source files.

For example, just replace /var/www/html/themes/example

kind regards
marvin

problems to connect

steps to reproduce:

git clone https://github.com/nextcloud/docker
cd docker
docker build -t nextcloud .
docker run -d -p 9000:9000

If I now try to connect on localhost:9000 I get nothing. Compare that to nginx where I run:
docker run -d -p 80:80 --name webserver nginx

Then I can connect on localhost:80.

PCNTL Warning

Using 11.0.2-apache and replacing entrypoint.sh by some script which pre-configures the installation using occ I get this warning whenever occ is issued:

The process control (PCNTL) extensions are required in case you want to interrupt long running commands

Is this by intent? May the baseimage should provide the extension? Or am I doing something wrong here?

Thank you very much!

Can't run a scan

A scan require the user to be www-data but www-data can't run a php script, what should I do?

occ is not executable

I had to:

chmod +x ./occ

not sure if related to nextcloud itself or docker, will investigate.

Update Description

Hey,

maybe we should update the description a little bit instead of just linking to IndieHosters/Nextcloud:

  • Explain that this container does not include a webserver and needs one in front (even to run locally)
  • How to update
  • etc.

Apps Persistence not fully working

Hi everyone,
I am using this docker behind some reverse proxy as suggested with the three volumes suggested.
(.../apps .../config .../data) and persisted them on the host drive.
Nevertheless when I do this:
docker pull
docker stop nextcloud-docker
docker rm nextcloud-docker
docker run -d ... (including all the options from before)

-> All apps are disabled again. If reenabled they will come up with their old datasets, so appearently my e.g. calender gets saved as supposed but the fact that this app was enabled does not get saved.

  1. Is this expected behaviour?
  2. Can I persist the apps status in any way?
    Cheers

Add cron service

In order to keep things easy for image users (less additional config required), add cron service similar to wonderfall/nextcloud. This might require a service manager like s6. Nexcloud can be preconfigured to use cron automatically.

Migrate to PHP 7

It would be nice if the Docker image could benefit from the increased speed of PHP7.

Password not working during setup

Today I faced a funny problem. I tried a lot to setup a new Nextcloud instance and thought it can't be... username and password work fine from everywhere but not from Nextcloud setup.

Than I changed the password to a very simple one test and everything worked fine. After the setup I changed this stupid password to a strong one manually in the config.php and also this strong one works fine.

It looks like during setup the password is not "encoded" correctly.

The password that has not worked during during install was something like this: TuriKatePeri9.

It might be the dot at the end...

SSL Required

Hi there - the Docker image seems to be having an issue when attempting to connect to MySQL (remote) if remote requires SSL, is there a way to support that (my server is set to require SSL).

Permission warnings even though everything seems to be OK

screen shot 2017-03-05 at 14 46 47
I grew tired of waiting 11.0.2 image to be released, so I copy pasted the Dockerfile (& entrypoint) to myself and built on it.

Before updating, I stopped all containers, removed all unnamed volumes (/var/www/html) and then started everything up.

I run the updater with ./occ upgrade (which was NOT executable by default, had to use php ./occ upgrade as www-data).

I then ran this script with this output:

Creating possible missing Directories
chmod Files and Directories
chown Directories
chmod/chown .htaccess

I still get these errors. Everything is owned by www-data and it (owner) has write permissions to data, config, apps, config.php etc...

I do not have SELinux installed.

Edit: Forgot the original screen shot..

IGNORE::: FIXED:::?error? at end of build?

Hi. I cloned the directory and ran sudo docker build -t nextcloud . It ran, but at the end it
Removing intermediate container 4087865abe3a Step 9 : COPY docker-entrypoint.sh /entrypoint.sh stat /var/lib/docker/aufs/mnt/65213200a90a4038e89d2b9d6bb4b33baa0d2d7bf933b6549d6ce336f2dc12a4/entrypoint.sh: no such file or directory
I assume my build arguments were insufficient?

Uncaught Exception: Could not gather sufficient random data

Hey,

after i pulled the current Docker image (22e6f0d29aea) i got this error:

Updating permissions...
Updating permissions in /nextcloud...
Permissions in /data are correct.
Permissions in /config are correct.
Permissions in /apps2 are correct.
Updating permissions in /etc/nginx...
Updating permissions in /etc/php7.1...
Updating permissions in /var/log...
Updating permissions in /var/lib/nginx...
Updating permissions in /tmp...
Updating permissions in /etc/s6.d...
Done updating permissions.
Starting automatic configuration...
PHP Fatal error:  Uncaught Exception: Could not gather sufficient random data in /nextcloud/lib/private/Security/SecureRandom.php:81
Stack trace:
#0 /nextcloud/lib/private/Security/SecureRandom.php(81): random_int(0, 63)
#1 /nextcloud/lib/private/AppFramework/Http/Request.php(576): OC\Security\SecureRandom-&gt;generate(20)
#2 /nextcloud/lib/private/Log/File.php(93): OC\AppFramework\Http\Request-&gt;getId()
#3 [internal function]: OC\Log\File::write('PHP', 'Exception: Coul...', 3)
#4 /nextcloud/lib/private/Log.php(300): call_user_func(Array, 'PHP', 'Exception: Coul...', 3)
#5 /nextcloud/lib/private/Log.php(158): OC\Log-&gt;log(3, 'Exception: Coul...', Array)
#6 /nextcloud/lib/private/Log/ErrorHandler.php(81): OC\Log-&gt;critical('Exception: Coul...', Array)
#7 [internal function]: OC\Log\ErrorHandler::onException(Object(Exception))
#8 {main}

Update to 11

Hello,

I would to ask when the image will be update to 11? Now version 11.0.1 of Nextcloud is available but docker version stay an 10. If it will take some days I will think about clone it and try to update it by my own or are there problems to do this?

Thank you and best regards
Wolfgang

Plain setup page

Hi there,

Sorry for bothering you guys but I've been trying to solve this on my own but I can't seem to find anything I'm doing wrong. Nor anyone who ran into a similar problem.

I've followed the example from indiehosters/nextcloud but made a few tweaks and it's booting nicely, but when I go to the web page I see the following:
image
I get the same screen with IE, chrome and chrome incognito (with extensions disabled). I verified that it wasn't my reversed proxy as when I bypass it I have the same issue.

Do you have any idea what could be the issue or what info do you need?

Maintainer

One last thing before being able to PR docker, we need a maintainer email.

Is docker [at] nextcloud.com good?

Let me know, and then, we can PR.

Pierre

Explain examples

I'm trying to migrate from a nextcloud docker build that seems to no longer be supported, and figuring out setup. Your readme refers to another site for docker-compose, but you actually have a docker-compose file in the examples folder. Could you add some description around how it works/how to use it?

Update Failed

Hi i use the snowmb docker-compose file and updated nextcloud with the WebUpdater (maybe the problem). After the update and a restart i have the following message:
Downgrading is not supported and is likely to cause unpredictable issues (from 9.1.2.2 to 9.1.1.5)

When i change the version in the config file to 10.0.2 the i have the following message:
Downgrading is not supported and is likely to cause unpredictable issues (from 10.0.2 to 9.1.1.5)

Thanks for your support.

php-fpm / config issue? "Access to the script has been denied"

(Apologies if this is the wrong place for this - I'm new to github)

I have been trying to get the nextcloud docker image working, but have either misunderstood the instructions, or something isn't working.

I am running nextcloud as follows (I already have something else listening on port 9000)
# docker run --name nextcloud -d -p 8001:9000 indiehosters/nextcloud
and I am using Apache as a proxy to access it (Took me ages to figure out that I couldn't simply point a web browser at the HTTP port - I have never used php-fpm before) :

Listen 1.2.3.100:81
<VirtualHost 1.2.3.100:81>
        ProxyPassMatch "^/(.*)" "fcgi://127.0.0.1:8001/var/www/html/$1"
</VirtualHost>

This seems to work in that the php scripts themselves run fine, but none of the support files come through, they don't get passed to the browser.

[Mon Oct 10 00:44:07 2016] [error] [client 1.2.3.4] AH01071: Got error 'Access to the script '/var/www/html/core/vendor/backbone/backbone.js' has been denied (see security.limit_extensions)\n'
[Mon Oct 10 00:44:07 2016] [error] [client 1.2.3.4] AH01071: Got error 'Access to the script '/var/www/html/core/js/oc-backbone.js' has been denied (see security.limit_extensions)\n\xff\x7f'
[Mon Oct 10 00:44:07 2016] [error] [client 1.2.3.4] AH01071: Got error 'Access to the script '/var/www/html/core/js/placeholder.js' has been denied (see security.limit_extensions)\n\xff\x7f'
[....]

Am I missing something basic in the config somewhere, or am I misunderstanding how this is meant to fit together?

Connection reset by peer on container start

Once started I am unable to connect to the container over HTTP

Build

$ docker build -t nextcloud github.com/nextcloud/docker

Run

$ docker run -d -p 80:80 nextcloud

Logs

[02-Aug-2016 20:56:27] NOTICE: fpm is running, pid 1
[02-Aug-2016 20:56:27] NOTICE: ready to handle connections

Test

$ curl http://127.0.0.1:80
curl: (56) Recv failure: Connection reset by peer

Port running on 80 instead of 9000

I couldn't access anything on port 9000. I had to append -p 9000:80 to get the container working. Am I doing something wrong, or is the documentation not up-to-date?

Official?

Will this docker (indiehosters/nextcloud) converted to the official nextcloud docker image?

Nextcloud login TTFB very high (~30 sec) after a few hours via SSL + NGINX

Hello,

I am very sorry to post such an issue, as I fear it is a problem with my setup but I am trying to fix this since 3 months now and I am left out of ideas.

I have the following problem:

  • TTFB after one day is at ~30 sec. It slowly raises from ~650 ms after a docker service restart. Restarting or removing/creating the containers won't fix it only a docker service restart.
  • TTFB won't get higher or lower. It just takes ~30 sec to login no matter what, even if the server is under some load.
  • If I access nextcloud via the exposed container port 80 (without nginx proxy) TTFB resides at about ~400ms.
  • The TTFB is only high when I try to login. Everything else is < ~1 sec.
  • other applications like rocket.chat, kanboard, openldap, discourse work flawlessly with ssl enabled, nginx reverse proxy and openldap

My Setup:

  • Ubuntu LTS 14.04
  • Docker version 1.12.5, build 7392c3b
  • user login via openldap
  • tested with NGINX 1.5.9, NGINX 1.10.3 and docker jwilder/nginx-proxy
  • tested with docker wonderfall/nextcloud:11.0 and docker nextcloud:11.0
  • tested with acpu cache and redis cache
  • using system cron
  • lets encrypt ssl
  • 8 GB RAM
  • quad amd 2.4 GHZ

What I tried so far:

  • moving everything to an SSD (volumes + /var/lib/docker)
  • exchangend acpu with redis
  • tried nextcloud 10 and 11 (with 11 it gets even worse because of removed asset pipelining I guess)
  • tried various nginx versions
  • tried to enable http2 but I can't get it to work with nginx reverse proxy
  • switched from wonderfall/nextcloud to this image
  • tried to disable ssl but which makes it faster but still results in TTFB > ~30sec
  • checked iotop (all good and normal)
  • checked htop (all good and normal)

Thanks for any help!

v12 image

Since v12 was freshly released, do we have a timeline on getting a Docker image for it?

fpm container file ownership and permission changes

The nextcloud:11.0.3-fpm container has changed the ownership and permissions of the files in /var/www/html. This prevents my nginx container that has mounted the /var/www/html volume from accessing the files:

017/05/07 02:45:14 [crit] 7#7: *1718 stat() "/var/www/html/status.php" failed (13: Permission denied),

The files in nextcloud:11.0.3-fpm are owned by root:www-data and are not world readable:

$ docker run -it --rm nextcloud:11.0.3-fpm ls -lha /var/www/html/version.php
-rw-r----- 1 root www-data 380 Apr 22 06:29 /var/www/html/version.php

Previously (<=nextcloud:11.0.2-fpm) the files were owned by www-data:nogroup and were world readable.

$ docker run -it --rm nextcloud:11.0.2-fpm ls -lha /var/www/html/version.php
-rw-r--r-- 1 www-data nogroup 277 Feb 26 19:44 /var/www/html/version.php

Was this changed intended?

11.0.2 docker images

Hey Folks,

please update the dockerfiles and push the 11.0.2 docker images.

thank you in advance,
Harm

hub.docker.com out of sync?

The git repo has been updated more than a week ago but hub.docker.com still provides n-1 version of nextcloud.

Not sure this is the right place to report it, please forward or tell where to request an update.

Cheers and thanks for the work on nextcloud docker images

Request Entity Too Large

I get errors when using Nextcloud Image over https (nginx-proxy), but works fine with http:

Error Downloading https://.../remote.php/webdav/...... - server replied: Request Entity Too Large.

Possibly something to do with the PHP-Settings in the container?

Data directory permissions error message (docker for windows)

After completing the web setup wizard on a new Nextcloud docker container, I am getting the following error message:
Data directory (/var/www/html/data) is readable by other users. Please change the permissions to 0770 so that the directory cannot be listed by other users.

The docker image I am using is version 11 apache latest. I looked at the dockerfile and I can't see anywhere that the permissions are being set according to the requirement mentioned in the error message. Is this an omission?

Other information. I am running docker via docker tool box on Windows 7 and am mounting an NTFS directory for /var/www/html via the docker -v argument.

No version tags

Currently this repo (and the associated repo on the Docker Hub) doesn't have any version tags. This means that users can't pin their install to a particular version. The best way of handling this would be to have different branches of this repo with different nextcloud versions pinned in each Dockerfile. AFAIK it should be possible to configure the Docker hub to handle this.

Also, are there any plans to get this integrated into the actual docker-library/, like owncloud is? You could always emails @tianon and similar maintainers of that project to see if they'd be open to having nextcloud hosted in a similar way to owncloud.

ServerTokens enabled in Apache Image

Current

error

The current configuration of the apache does not have the ServerToken disabled.

Expected

The apache webserver does not show the server version etc. in error messages + HTTP responses.

Environment

REPOSITORY                   TAG                 IMAGE ID            CREATED             SIZE
nextcloud                    11                  76c9c2e2e771        2 days ago          622MB

Permission denied error for config directory in examples

I used the examples docker compose file and with some small modifications (domain name set) I get the following errors from the nextcloud page:

`Can't write into config directory!

This can usually be fixed by giving the webserver write access to the config directory.`

The following errors are shown on the nextcloud-fpm container console:

PHP message: {"reqId":"J8dbbzhk41yQ6bR4\/K\/+","remoteAddr":"172.18.0.6","app":"PHP","message":"fopen(\/var\/www\/html\/config\/config.php): failed to open stream: No such file or directory at \/var\/www\/html\/lib\/private\/Config.php#230","level":3,"time":"2017-05-18T19:09:06+00:00","method":"GET","url":"\/","user":"--","version":""} PHP message: {"reqId":"J8dbbzhk41yQ6bR4\/K\/+","remoteAddr":"172.18.0.6","app":"PHP","message":"chmod(): No such file or directory at \/var\/www\/html\/lib\/private\/Config.php#233","level":3,"time":"2017-05-18T19:09:06+00:00","method":"GET","url":"\/","user":"--","version":""}" while reading response header from upstream, client: 172.18.0.6, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://172.18.0.3:9000", host: "[...].ddns.net" 2017/05/18 19:09:06 [error] 5#5: *1 FastCGI sent in stderr: "PHP message: {"reqId":"J8dbbzhk41yQ6bR4\/K\/+","remoteAddr":"172.18.0.6","app":"PHP","message":"chmod(): No such file or directory at \/var\/www\/html\/lib\/private\/Log\/File.php#119","level":3,"time":"2017-05-18T19:09:06+00:00","method":"GET","url":"\/","user":"--","version":""}" while reading upstream, client: 172.18.0.6, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://172.18.0.3:9000", host: "[...].ddns.net" 2017/05/18 19:11:08 [error] 5#5: *56 FastCGI sent in stderr: "PHP message: {"reqId":"tJuu66dEOjjKrdvZuVC3","remoteAddr":"172.18.0.1","app":"PHP","message":"touch(): Unable to create file \/var\/www\/html\/config\/config.php because Permission denied at \/var\/www\/html\/lib\/private\/Config.php#229","level":3,"time":"2017-05-18T19:11:08+00:00","method":"GET","url":"\/","user":"--","version":""} PHP message: {"reqId":"tJuu66dEOjjKrdvZuVC3","remoteAddr":"172.18.0.1","app":"PHP","message":"fopen(\/var\/www\/html\/config\/config.php): failed to open stream: No such file or directory at \/var\/www\/html\/lib\/private\/Config.php#230","level":3,"time":"2017-05-18T19:11:08+00:00","method":"GET","url":"\/","user":"--","version":""} PHP message: {"reqId":"tJuu66dEOjjKrdvZuVC3","remoteAddr":"172.18.0.1","app":"PHP","message":"chmod(): No such file or directory at \/var\/www\/html\/lib\/private\/Config.php#233","level":3,"time":"2017-05-18T19:11:08+00:00","method":"GET","url":"\/","user":"--","version":""}" while reading response header from upstream, client: 172.18.0.1, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://172.18.0.3:9000", host: "172.18.0.2"

This looks like wrong permissions inside the container. (I usually would spend more time with it but I think your docker experience is better than mine and I think others would also profit from this information)

Can you help me on that and extend the readme file or an examples documentation for the things which cannot be found in an existing manual (like setting correct env vars)

Collabora timeout with docker-compose

finally have everything up and running at cloud.example.com using the default docker-compose up environment.

collabora, though, seems to be giving me trouble. I had enabled the app, and in it's settings, I have https://cloud.example.com as the URL. trying to edit a file, however, times out.

relevant errors in the logs:

web_1                    | 2017/05/23 17:43:18 [error] 6#6: *4200 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 172.19.0.2, server: , request: "GET /index.php/apps/richdocuments/index?fileId=31&requesttoken=e5p1D1t2lBRXTIKI9AC1zSSmp%2Bm6FhpV5nakk%2F5zoJc%3D%3AEKIvPhEj1XxlGLrZgWfyqFWT5ZH9X3M6lzXOo7AmmPM%3D HTTP/1.1", upstream: "fastcgi://172.19.0.6:9000", host: "cloud.example.com"
proxy                    | nginx.1    | 2017/05/23 17:43:18 [error] 65#65: *2004 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 192.168.200.182, server: cloud.example.com, request: "GET /index.php/apps/richdocuments/index?fileId=31&requesttoken=e5p1D1t2lBRXTIKI9AC1zSSmp%2Bm6FhpV5nakk%2F5zoJc%3D%3AEKIvPhEj1XxlGLrZgWfyqFWT5ZH9X3M6lzXOo7AmmPM%3D HTTP/2.0", upstream: "http://172.19.0.7:80/index.php/apps/richdocuments/index?fileId=31&requesttoken=e5p1D1t2lBRXTIKI9AC1zSSmp%2Bm6FhpV5nakk%2F5zoJc%3D%3AEKIvPhEj1XxlGLrZgWfyqFWT5ZH9X3M6lzXOo7AmmPM%3D", host: "cloud.example.com"

can't bring up docker-compose

Creating redis
Creating proxy
Creating collabora
Creating db
Creating nextcloud_fpm
Creating letsencrypt-companion
Creating nextcloud_webserver

ERROR: for web  Cannot start service web: containerd: container not started
ERROR: Encountered errors while bringing up the project.

Looks like this is the culprit:

db                       | error: database is uninitialized and password option is not specified
db                       |   You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD

Brand new ubuntu 16.04 host. Any ideas?

Docker image latest not starting Nextcloud 11.0.2

Since weeks I see the hint "Nextcloud 11.0.2 is available" when I log into my nextcloud docker instance.

I pulled the new version and now have this images:

sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nextcloud           latest              5d0d70f314ea        3 days ago          620 MB
mysql               latest              5faba1a71ec4        4 days ago          407 MB

I started the image by

sudo docker run --name nextcloud --link mysql:mysql -p 8080:80 -v /data/nextcloud:/var/www/html -d nextcloud:latest

I got PHP Version 7.1.3 which is really nice, but still not Version 11.0.2.

On the Docker Hub It's shown that version 11.0.2 is the same as latest:

11.0.2-apache, 11.0-apache, 11-apache, apache, 11.0.2, 11.0, 11, latest (11.0/apache/Dockerfile)

"This version of Nextcloud is not compatible with PHP 7.1"

I might be missing something basic, but I can no longer run the nextcloud 9 or 10 docker images (v11 works fine)

I get the following output from my build script (pasted in below). Instead of "php occ upgrade" actually running (in this example it should tell me that Nextcloud is not installed) it says:
This version of Nextcloud is not compatible with PHP 7.1.<br/>You are currently running 7.1.2.

I don't think v9 or v10 support PHP 7.1 ... ? I expect this was introduced as of #34. Sadly I need v9 and v10 in order to perform a migration from OC v8.

build.sh :

#!/bin/sh

if [ "$1" == "" ]; then
        echo Usage: $0 version
        echo e.g. $0 10.0
        exit
fi
NEXTCLOUDVER=$1

if [ -f docker-entrypoint.sh ]; then rm docker-entrypoint.sh; fi
if [ -f Dockerfile ]; then rm Dockerfile; fi

wget https://github.com/nextcloud/docker/raw/master/${NEXTCLOUDVER}/apache/docker-entrypoint.sh https://github.com/nextcloud/docker/raw/master/${NEXTCLOUDVER}/apache/Dockerfile
chmod +x docker-entrypoint.sh

# Stop any running nextcloud instances (any)
docker ps | grep nextcloud-test- | tr -s ' ' | cut -f 2 -d ' ' | xargs -n 1 docker stop

# Remove the old instance before we rebuild it
docker rm nextcloud-test-${NEXTCLOUDVER}

docker build -t nextcloud-test-${NEXTCLOUDVER} . && \
docker run --name nextcloud-test-${NEXTCLOUDVER} \
        -d \
        -p 127.0.0.1:8081:80 \
        nextcloud-test-${NEXTCLOUDVER}

docker exec -it nextcloud-test-${NEXTCLOUDVER} bash -c "apt-get update && apt-get install -y sudo vim"

# This will fail:
docker exec -it nextcloud-test-${NEXTCLOUDVER} bash -c "sudo -u www-data php occ upgrade"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.