docker pull rabbitmq
自定義的rabbitmq Dockerfile
# base image
FROM rabbitmq:3.7-management
# running required command
RUN rabbitmq-plugins enable --offline rabbitmq_management rabbitmq_management_agent rabbitmq_shovel rabbitmq_mqtt rabbitmq_federation_management rabbitmq_stomp rabbitmq_web_mqtt
命令行進入到 Dockerfile的目錄下,運行
docker build -t test_rabbitmqtt:v1 .
run:
默认的 rabbitmqtt 运行的容器中,端口情况是 4369/tcp, 5671-5672/tcp, 15671-15672/tcp, 25672/tcp
sudo docker run -d -p 4369:4369 -p 5671:5671 -p 5672:5672 -p 15671:15671 -p 15672:15672 -p 15675:15675 --name testrabbitmq test_rabbitmqtt:v1
其它Docker 命令记录
gitblit
docker pull jacekkow/gitblit
sudo docker run -d --name=gitblit \
-p 8084:8080 -p 8443:8443 \
-p 9418:9418 -p 29418:29418 \
jacekkow/gitblit
jenkins
sudo docker run -p 0.0.0.0:8083:8080 -p 50003:50000 -v /home/vagrant/docker/jenkins:/var/jenkins_home jenkins
gogs
docker run --name=gogs -p 10022:22 -p 10080:3000 -v /var/gogs:/data gogs/gogs
进入在运行的容器中执行命令
sudo docker exec -it gogs /bin/bash
mysql
sudo docker run -d -p 13306:3306 --name mysqlgogs -v /opt/mydata/:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 mysql:latest
进入在运行的容器中执行命令
docker exec -it mysqlgogs /bin/bash
创建 utf8_general_ci 的数据库sql语句
CREATE DATABASE gogs DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
laravel 數據迁移命令
执行 php artisan migrate
执行 数据迁移
执行 php artisan migrate:rollback
回滚