Public Repository

Last pushed: 8 months ago
Short Description
Golang with mariadb environment
Full Description

Usage:

Command related to mariadb

Command Details
--privileged Given access to all devices
-e "container=docker" Set environment variable
-v /sys/fs/cgroup/:/sys/fs/cgroup Mount /sys/fs/cgroup/
-p 3306:3306 Open mysql port 3306
-e MARIADB_PASS="YOUR_PASSWORD" Set your mariaDB password *1
--volumes-from OTHER_CONTAINER_DB Mount database data from other container

1 : You MUST set the password for DB root

Others command

Command Details
-net host Use the host's network stack inside the container.
-v YOUR_GOPATH:/goProgram Mount your go work dir to default goProgram path

Start Container:

The complete start command:

docker run --privileged -idt --name gomaria -e "container=docker" -v /sys/fs/cgroup/:/sys/fs/cgroup -p 3306:3306 -e MARIADB_PASS="YOUR_PASSWORD" --volumes-from OTHER_CONTAINER_DB --net host --log-driver none -v YOUR_GOPATH:/goProgram lukewayne123/golang-mariadb

Reference

Generate golang with mariadb environment
refer to
https://hub.docker.com/r/million12/mariadb/
https://hub.docker.com/r/richarticle/golang-dev/

Docker Pull Command
Owner
lukewayne123

Comments (0)