docker mediawiki localsettings with docker run - docker

If I run mediawiki by docker run:
docker run --name wiki --link mysql -p 81:80 -d mediawiki
Where I have to put the LocalSettings.php file?
Thank you very much.

You mount the settings file from the host:
docker run --name wiki --link mysql -p 81:80 -v /path/on/your/computer/to/LocalSettings.php:/var/www/html/LocalSettings.php -d mediawiki

Related

Docker, unable to run Ghost on default port 2368

Using Official (Docker) image from docker hub:
I was expecting this to work on the default port 2368
but localhost:2368 just hung
docker run -d --name some-ghost2 -v some-ghost-data:/var/lib/ghost/content ghost
localhost:3001 worked
docker run -d --name some-ghost2 -v -p 3001:2368 some-ghost-data:/var/lib/ghost/content ghost
Then the links in the introduction pages failed as they linked to 2368
The fix, which took me a while to get to:
docker run -d --name some-ghost2 -v -p 2368:2368 some-ghost-data:/var/lib/ghost/content ghost

Unoconv call (openoffice) from other container

I am new in linux and docker. I need to convert odt files to pdf from php container. I use php-5.6-apache and https://github.com/xiaojun207/openoffice4-daemon:
sudo docker build --pull
-t xiaojun207/openoffice4-daemon
–build-arg OO_VERSION=4.1.7 .
sudo docker run -d --restart unless-stopped
-u 123456
–name soffice
–net my-network
-p 8100:8100
-v /data/output-odt:/pdfs/:rw
xiaojun207/openoffice4-daemon:latest
sample of openoffice4-daemon works well from host:
sudo docker run
-v /var/output-odt:/pdfs:rw
xiaojun207/openoffice4-daemon
–net my-network
unoconv --connection ‘socket,host=127.0.0.1,port=8100,tcpNoDelay=1;urp;StarOffice.ComponentContext’
-f pdf /pdfs/test.odt
But I need to execute it from my php container. docker run is not possible from other container. How can I do it? Thanks

I try to mount a created database from host, name mydb, onto mysql container here is what I’ve tried:

I try to mount a created database from host, name mydb, onto mysql container here is what I’ve tried:
sudo docker run -v mysql-data:/var/lib/mysql/mydb/ --name mysql_web -e MYSQL_ROOT_PASSWORD=12345 -p 3306:3306 -d mysql:5.7
root#ip-172-31-16-134:/var/lib/mysql# sudo docker run -v mysql-data:/var/lib/mysql/mydb/ --name mysql_web -e MYSQL_ROOT_PASSWORD=12345 -p 3306:3306 -d mysql:5.7
3c0a8eb588c0dd0d0b7b72a727912744f44e744e700de7efc64a0c4c1f651685
root#ip-172-31-16-134:/var/lib/mysql# docker exec -it mysql_web bash
Error response from daemon: Container 3c0a8eb588c0dd0d0b7b72a727912744f44e744e700de7efc64a0c4c1f651685 is not running
but it works when I change where to mount…
sudo docker run -v mysql-data:/var/lib/mydb/ --name mysql_web -e MYSQL_ROOT_PASSWORD=12345 -p 3306:3306 -d mysql:5.7
root#ip-172-31-16-134:/var/lib/mysql# sudo docker run -v mysql-data:/var/lib/mydb/ --name mysql_web -e MYSQL_ROOT_PASSWORD=12345 -p 3306:3306 -d mysql:5.7
06233eeb864c32ff16d6542e632a4da3ff6dfbd4a30fcc9aac8086dfc1245948
root#ip-172-31-16-134:/var/lib/mysql# docker exec -it mysql_web bash
root#06233eeb864c:/# cd /var/lib/mydb
root#06233eeb864c:/var/lib/mydb# exit
exit
seems It can’t mount onto specific folder and I don’t know why, I just want both databases, one from host, and the other from container, synced itself instead of loading dump.sql everytime when I start a new container.
any suggestion would help , thanks
This is known issue for the error you got [ERROR] --initialize specified but the data directory has files in it. Aborting.
What this error means is explained here.
Try few things like
Adding --ignore-db-dir=lost+found as mentioned here.
Providing exact path of data directory on host and mount on to container path at /var/lib/mysql like this docker run -v /path/to/mysql-data:/var/lib/mysql --name mysql_web -e MYSQL_ROOT_PASSWORD=12345 -p 3306:3306 -d mysql:5.7 as mentioned here.
Hope this helps.

Link containers to a running container

I want to know if I can link Docker containers to a running container. I am running this command on a server:
docker run -d -u jenkins --name appdev-jenkins --network=host --memory="8g" -p 80:8080 -p 443:443 -p 50000:50000 -v "/opt/jenkins":/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock jenkinsci/blueocean
I want to be able to link another Jenkins instance as an agent to the original Jenkins instance. Is this possible?
Have you tried the following?
docker run -d --link appdev-jenkins --name second-jenkins [other params]

Docker port rewrite

I used docker for wordpress like this:
Create volume containers:
$ docker create -v /home/juanda/project/bbdd:/var/lib/mysql --name bbdd ubuntu /bin/true
$ docker create -v /home/juanda/project/web:/var/www/html --name web ubuntu /bin/true
Mysql container:
$ docker run --volumes-from bbdd --name mysql -e MYSQL_ROOT_PASSWORD="xxxx" -d mysql
Apache, php and wordpress container:
$ docker run --volumes-from web --name apache --link mysql:mysql -d -p 5555:80 wordpress
I installed and ran everything ok. If I remove apache container (stop and rm) and I launch it awain in another port (8080 instead of 5555), it rewrites url in navigator to 5555 and I get a connection error. Any idea?

Resources