- create the data dir
mkdir -p /home/pi/mongo/data
- run the following docker command:
docker run --restart always -d -p 27017:27017 -p 28017:28017 -e AUTH=no -v /home/pi/mongo/data:/data/db --name mongo izone/arm:mongo-3.0.9
-
create the data dir
mkdir -p /home/pi/postgres/data
-
create the root password and store it at /home/pi/postgres/root_password
-
run the following docker command:
docker run --restart always -d -p 5432:5432 -v /home/pi/postgres/root_password:/run/secrets/postgres-passwd -v /home/pi/postgres/data:/var/lib/postgresql/data -e="POSTGRES_PASSWORD_FILE=/run/secrets/postgres-passwd" --name postgres postgres:11.5-alpine
convenient command for psql:
docker run -it --rm postgres:11.5-alpine psql -h $(dig raspberrypi +short) -U postgres
- create the data dir
mkdir -p /home/pi/redis/data
- add the config to /home/pi/redis/redis.conf
- run the following docker command:
docker run --restart always -d -p 6379:6379 -v "/home/pi/redis/data":/data -v /home/pi/redis/redis.conf:/etc/redis/redis.conf --name redis redis:5.0.5-alpine3.10 redis-server /etc/redis/redis.conf
- create the data dir
mkdir -p /home/pi/mysql/data
- run the docker command:
docker run --restart always -d -p 3306:3306 -v /home/pi/mysql/data/:/var/lib/mysql -e="MYSQL_ROOT_PASSWORD=xxxxxxxxxxxxxxx" --name mysql jsurf/rpi-mariadb:latest