You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/docker.md
+14-15
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,5 @@
1
1
# Run Percona Server for MySQL in a Docker Container
2
2
3
-
4
3
Docker lets developers build, deploy, run, update, and manage containers, which isolate applications from the host system. Docker containers are made from Docker images, which are snapshots of the configuration needed to run an application, such as the code and libraries.
5
4
6
5
??? information "Percona solutions"
@@ -78,8 +77,8 @@ available locally.
78
77
79
78
To view the container's logs, use the following command:
80
79
81
-
```shell
82
-
docker logs ps --follow
80
+
```{.bash data-prompt="$"}
81
+
$ docker logs ps --follow
83
82
```
84
83
??? example "Expected output"
85
84
@@ -158,8 +157,8 @@ Be sure to test the image throughly before using it in production.
158
157
159
158
You can pass options with the `docker run` command. For example, the following command uses UTF-8 as the default setting for character set and collation for all databases:
160
159
161
-
```shell
162
-
[root@docker-host] $ docker run -d \
160
+
```{.bash data-prompt="$"}
161
+
$ docker run -d \
163
162
--name ps \
164
163
-e MYSQL_ROOT_PASSWORD=root \
165
164
percona/percona-server:8.0 \
@@ -173,8 +172,8 @@ The `docker exec` command lets you have a shell inside the container. This comma
173
172
174
173
An example of accessing the detached container:
175
174
176
-
```shell
177
-
[root@docker-host] $ docker exec -it ps /bin/bash
175
+
```{.bash data-prompt="$"}
176
+
$ docker exec -it ps /bin/bash
178
177
```
179
178
180
179
If you need to troubleshoot, the error log is found in `/var/log/` or `/var/log/mysql/`. The file name may be error.log or mysqld.log.
@@ -252,8 +251,8 @@ To link a container running your application
252
251
with the Percona Server container,
253
252
run it with the following command:
254
253
255
-
```shell
256
-
[root@docker-host] $ docker run -d \
254
+
```{.bash data-prompt="$"}
255
+
$ docker run -d \
257
256
--name app \
258
257
--link ps \
259
258
app/image:latest
@@ -281,8 +280,8 @@ For example, if you create a data directory on a suitable volume
281
280
on your host system named `/local/datadir`,
282
281
you run the container with the following command:
283
282
284
-
```shell
285
-
[root@docker-host] $ docker run -d \
283
+
```{.bash data-prompt="$"}
284
+
$ docker run -d \
286
285
--name ps \
287
286
-e MYSQL_ROOT_PASSWORD=root \
288
287
-v /local/datadir:/var/lib/mysql \
@@ -300,8 +299,8 @@ Do not add MYSQL_ROOT_PASSWORD to the `docker run` command if the data directory
300
299
301
300
If you have SELinux enabled, assign the relevant policy type to the new data directory so that the container will be allowed to access it:
0 commit comments