mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
docs: update mariadb example
podman-kube-generate created from pod: 1. podman volume create mariadb_data 2. podman run --env MARIADB_ROOT_PASSWORD=x --name some-mariadb \ -v mariadb_data:/var/lib/mysql -P -d mariadb:10.11 3. + command in doc. podman-run - using MARIADB_ROOT_PASSWORD environment variables for a while now. Signed-off-by: Daniel Black <daniel@mariadb.org>
This commit is contained in:
@ -65,42 +65,42 @@ The Kubernetes kind to generate in the YAML file. Currently, the only supported
|
||||
|
||||
Create Kubernetes Pod YAML for a container called `some-mariadb`.
|
||||
```
|
||||
$ sudo podman kube generate some-mariadb
|
||||
$ podman kube generate some-mariadb
|
||||
# Save the output of this file and use kubectl create -f to import
|
||||
# it into Kubernetes.
|
||||
#
|
||||
# Created with podman-0.11.2-dev
|
||||
# Created with podman-4.8.2
|
||||
|
||||
# NOTE: If you generated this yaml from an unprivileged and rootless podman container on an SELinux
|
||||
# enabled system, check the podman generate kube man page for steps to follow to ensure that your pod/container
|
||||
# has the right permissions to access the volumes added.
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
creationTimestamp: 2018-12-03T19:07:59Z
|
||||
creationTimestamp: "2024-01-09T02:24:55Z"
|
||||
labels:
|
||||
app: some-mariadb
|
||||
name: some-mariadb-libpod
|
||||
app: some-mariadb-pod
|
||||
name: some-mariadb-pod
|
||||
spec:
|
||||
containers:
|
||||
- command:
|
||||
- docker-entrypoint.sh
|
||||
- mysqld
|
||||
- args:
|
||||
- mariadbd
|
||||
env:
|
||||
- name: HOSTNAME
|
||||
- name: GOSU_VERSION
|
||||
value: "1.10"
|
||||
- name: GPG_KEYS
|
||||
value: "199369E5404BD5FC7D2FE43BCBCB082A1BB943DB \t177F4010FE56CA3336300305F1656F24C74CD1D8
|
||||
\t430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A \t4D1BB29D63D98E422B2113B19334A25F8507EFA5"
|
||||
- name: MARIADB_MAJOR
|
||||
value: "10.3"
|
||||
- name: MARIADB_VERSION
|
||||
value: 1:10.3.10+maria~bionic
|
||||
- name: MYSQL_ROOT_PASSWORD
|
||||
- name: MARIADB_ROOT_PASSWORD
|
||||
value: x
|
||||
image: quay.io/baude/demodb:latest
|
||||
image: docker.io/library/mariadb:10.11
|
||||
name: some-mariadb
|
||||
ports:
|
||||
- containerPort: 3306
|
||||
hostPort: 36533
|
||||
tty: true
|
||||
hostPort: 34891
|
||||
volumeMounts:
|
||||
- mountPath: /var/lib/mysql
|
||||
name: mariadb_data-pvc
|
||||
volumes:
|
||||
- name: mariadb_data-pvc
|
||||
persistentVolumeClaim:
|
||||
claimName: mariadb_data
|
||||
```
|
||||
|
||||
Create Kubernetes Deployment YAML with 3 replicas for a container called `dep-ctr`
|
||||
|
@ -604,7 +604,7 @@ $ podman run -v /var/cache/dnf:/var/cache/dnf:O -ti fedora dnf -y update
|
||||
|
||||
If the container needs a writeable mounted volume by a non root user inside the container, use the **U** option. This option tells Podman to chown the source volume to match the default UID and GID used within the container.
|
||||
```
|
||||
$ podman run -d -e MYSQL_ROOT_PASSWORD=root --user mysql --userns=keep-id -v ~/data:/var/lib/mysql:Z,U mariadb
|
||||
$ podman run -d -e MARIADB_ROOT_PASSWORD=root --user mysql --userns=keep-id -v ~/data:/var/lib/mysql:Z,U mariadb
|
||||
```
|
||||
|
||||
Alternatively if the container needs a writable volume by a non root
|
||||
@ -612,7 +612,7 @@ user inside of the container, the --userns=keep-id option allows users to
|
||||
specify the UID and GID of the user executing Podman to specific UIDs and GIDs
|
||||
within the container. Since the processes running in the container run as the user's UID, they can read/write files owned by the user.
|
||||
```
|
||||
$ podman run -d -e MYSQL_ROOT_PASSWORD=root --user mysql --userns=keep-id:uid=999,gid=999 -v ~/data:/var/lib/mysql:Z mariadb
|
||||
$ podman run -d -e MARIADB_ROOT_PASSWORD=root --user mysql --userns=keep-id:uid=999,gid=999 -v ~/data:/var/lib/mysql:Z mariadb
|
||||
```
|
||||
|
||||
Using **--mount** flags to mount a host directory as a container folder, specify
|
||||
|
Reference in New Issue
Block a user