Run update.sh

This commit is contained in:
Docker Library Bot 2017-02-10 12:32:43 -08:00
parent b8c50a7832
commit 8353eb4c98
1 changed files with 34 additions and 8 deletions

View File

@ -30,8 +30,8 @@ You should first install [Docker](https://www.docker.com/) on your machine.
Then there are several options: Then there are several options:
1. Get the [sources of this project](https://github.com/xwiki-contrib/docker-xwiki) and build them. 1. Pull the xwiki image from DockerHub.
2. Just pull the xwiki image from DockerHub. 2. Get the [sources of this project](https://github.com/xwiki-contrib/docker-xwiki) and build them.
## Pulling existing image ## Pulling existing image
@ -40,10 +40,34 @@ You need to run 2 containers:
- One for the XWiki image - One for the XWiki image
- One for the database image to which XWiki connects to - One for the database image to which XWiki connects to
The simplest is to use the Docker Compose file we provide. Run the following steps: ### Using docker run
- `wget https://raw.githubusercontent.com/xwiki-contrib/docker-xwiki/master/xwiki-mysql-tomcat/docker-compose-using.yml` Start by running a MySQL container and ensure you configure MySQL to use UTF8. The command below will also configure the MySQL container to save its data on your localhost in a `/my/own/mysql` directory:
- If you're not using the `latest` tag then use the corresponding GitHub branch/tag. For example for the `8.x` branch: `wget https://raw.githubusercontent.com/xwiki-contrib/docker-xwiki/8.x/xwiki-mysql-tomcat/docker-compose-using.yml`
```console
docker run --name mysql-xwiki -v /my/own/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=xwiki -e MYSQL_USER=xwiki -e MYSQL_PASSWORD=xwiki -e MYSQL_DATABASE=xwiki -d mysql:5.7 --character-set-server=utf8 --collation-server=utf8_bin --explicit-defaults-for-timestamp=1
```
You should adapt the command line to use the passwords that you wish for the MySQL root password and for the xwiki user password.
Then run XWiki in another container by issuing the following command:
```console
docker run --name xwiki -p 8080:8080 -v /my/own/xwiki:/usr/local/xwiki -e MYSQL_USER=xwiki -e MYSQL_PASSWORD=xwiki -e MYSQL_DATABASE=xwiki --link mysql-xwiki:db xwiki:mysql-tomcat
```
Be careful to use the same MySQL username, password and database names that you've used on the first command to start the MySQL container.
### Using docker-compose
Another solution is to use the Docker Compose file we provide. Run the following steps:
- `wget https://raw.githubusercontent.com/xwiki-contrib/docker-xwiki/master/xwiki-mysql-tomcat/mysql/xwiki.cnf`: This will download the MySQL configuration (UTF8, etc)
- If you don't have `wget` or prefer to use `curl`: `curl -fSL https://raw.githubusercontent.com/xwiki-contrib/docker-xwiki/master/xwiki-mysql-tomcat/mysql/xwiki.cnf -o xwiki.cnf`
- If you're not using the `latest` tag then use the corresponding GitHub branch/tag. For example for the `8.x` branch: `wget https://raw.githubusercontent.com/xwiki-contrib/docker-xwiki/8.x/xwiki-mysql-tomcat/mysql/xwiki.cnf`
- `wget -O docker-compose.yml https://raw.githubusercontent.com/xwiki-contrib/docker-xwiki/master/xwiki-mysql-tomcat/docker-compose-using.yml`
- If you don't have `wget` or prefer to use `curl`: `curl -fSL https://raw.githubusercontent.com/xwiki-contrib/docker-xwiki/master/xwiki-mysql-tomcat/docker-compose-using.yml -o docker-compose.yml`
- If you're not using the `latest` tag then use the corresponding GitHub branch/tag. For example for the `8.x` branch: `wget -O docker-compose.yml https://raw.githubusercontent.com/xwiki-contrib/docker-xwiki/8.x/xwiki-mysql-tomcat/docker-compose-using.yml`
- You can edit the compose file retrieved to change the default username/password and other environment variables. - You can edit the compose file retrieved to change the default username/password and other environment variables.
- `docker-compose up` - `docker-compose up`
@ -58,15 +82,15 @@ services:
- db - db
ports: ports:
- "8080:8080" - "8080:8080"
volumes:
- xwiki-data:/var/lib/xwiki
environment: environment:
- MYSQL_USER=xwiki - MYSQL_USER=xwiki
- MYSQL_PASSWORD=xwiki - MYSQL_PASSWORD=xwiki
volumes:
- xwiki-data:/usr/local/xwiki
db: db:
image: "mysql:5.7" image: "mysql:5.7"
volumes: volumes:
- ./mysql/xwiki.cnf:/etc/mysql/conf.d/xwiki.cnf - ./xwiki.cnf:/etc/mysql/conf.d/xwiki.cnf
- mysql-data:/var/lib/mysql - mysql-data:/var/lib/mysql
environment: environment:
- MYSQL_ROOT_PASSWORD=xwiki - MYSQL_ROOT_PASSWORD=xwiki
@ -108,6 +132,8 @@ The first time you create a container out of the xwiki image, a shell script (`/
Volumes: Volumes:
If you don't map any volume when using `docker run` or if you use `docker-compose` then Docker will create some internal volumes attached to your containers as follows.
- Two volumes are created: - Two volumes are created:
- A volume named `<prefix>_mysql-data` that contains the database data. - A volume named `<prefix>_mysql-data` that contains the database data.
- A volume named `<prefix>_xwiki-data` that contains XWiki's permanent directory. - A volume named `<prefix>_xwiki-data` that contains XWiki's permanent directory.