[root@iZ2zeg4pktzjhp9h7wt6doZ /]# docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 0e03bdcc26d7: Pull complete Digest: sha256:7e02330c713f93b1d3e4c5003350d0dbe215ca269dd1d84a4abc577908344b30 Status: Downloaded newer image for hello-world:latest
Hello from Docker! This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.
To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/
For more examples and ideas, visit: https://docs.docker.com/get-started/
2.9 将docker服务设为开机启动
1
systemctl enable docker
结果:
1
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.
docker run --name mysql01 -d mysql #出错 [root@iZ2zeg4pktzjhp9h7wt6doZ ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 661a9a06a0de mysql "docker-entrypoint.s…" 54 seconds ago Exited (1) 52 seconds ago mysql01 bfebea41f6c2 tomcat:latest "catalina.sh run" 5 hours ago Up 5 hours 0.0.0.0:8081->8080/tcp tomcat81 fde73047e23f tomcat:latest "catalina.sh run" 5 hours ago Up 5 hours 0.0.0.0:8082->8080/tcp tomcat82 45b32efc5bbb tomcat:latest "catalina.sh run" 6 hours ago Up 6 hours 0.0.0.0:8080->8080/tcp tomcat80 dfc9e2f59780 hello-world "/hello" 7 hours ago Exited (0) 7 hours ago intelligent_tharp #日志 [root@iZ2zeg4pktzjhp9h7wt6doZ ~]# docker logs mysql01 2021-03-04 09:39:47+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.23-1debian10 started. 2021-03-04 09:39:48+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' 2021-03-04 09:39:48+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.23-1debian10 started. 2021-03-04 09:39:48+00:00 [ERROR] [Entrypoint]: Database is uninitialized and password option is not specified You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD //没有指定MySql密码 #正确的命令 //指定密码 + 端口映射 docker run --name mysql01 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=Aa12345+ -d mysql
mysql配置文件
1 2 3 4 5 6 7 8
docker run --name myMysqlName -v /config/mysql:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:tag
Percona 为 MySQL 数据库服务器进行了改进,在功能和性能上较 MySQL 有着很显著的提升。该版本提升了在高负载情况下的 InnoDB 的性能、为 DBA 提供一些非常有用的性能诊断工具;另外有更多的参数和命令来控制服务器行为。
Percona Server 只包含 MySQL 的服务器版,并没有提供相应对 MySQL 的 Connector 和 GUI 工具进行改进。 Percona Server 使用了一些 google-mysql-tools, Proven Scaling, Open Query 对 MySQL 进行改造。