Advertisement
sandervanvugt

podman with storage

Jan 13th, 2021
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. [student@linfuncent ~]$ sudo mkdir /opt/dbfiles
  2. [student@linfuncent ~]$ sudo chmod o+w /opt/dbfiles
  3. [student@linfuncent ~]$ podman run -d --name mydbase -v /opt/dbfiles:/var/lib/mysql:Z -e MYSQL_USER=user -e MYSQL_PASSWORD=password -e MYSQL_DATABASE=mydbase registry.redhat.io/rhel8/mariadb-103
  4. Error: error creating container storage: the container name "mydbase" is already in use by "f76f56c08d9476243a9d5a74968ee4671a51ecd554a9af0583f980b60f7fcfd5". You have to remove that container to be able to reuse that name.: that name is already in use
  5. [student@linfuncent ~]$ podman rm mydbase
  6. f76f56c08d9476243a9d5a74968ee4671a51ecd554a9af0583f980b60f7fcfd5
  7. [student@linfuncent ~]$ podman run -d --name mydbase -v /opt/dbfiles:/var/lib/mysql:Z -e MYSQL_USER=user -e MYSQL_PASSWORD=password -e MYSQL_DATABASE=mydbase registry.redhat.io/rhel8/mariadb-103
  8. 83ba4312ebacd9e185ff003253ec3c7f248fd412b00c316e8930a4df81924c55
  9. [student@linfuncent ~]$ podman ps -a | grep mydb
  10. 83ba4312ebac registry.redhat.io/rhel8/mariadb-103:latest run-mysqld 8 seconds ago Exited (1) 8 seconds ago mydbase
  11. [student@linfuncent ~]$ podman logs mydbase
  12. => sourcing 20-validate-variables.sh ...
  13. => sourcing 25-validate-replication-variables.sh ...
  14. => sourcing 30-base-config.sh ...
  15. ---> 13:19:47 Processing basic MySQL configuration files ...
  16. => sourcing 60-replication-config.sh ...
  17. => sourcing 70-s2i-config.sh ...
  18. ---> 13:19:47 Processing additional arbitrary MySQL configuration provided by s2i ...
  19. => sourcing 40-paas.cnf ...
  20. => sourcing 50-my-tuning.cnf ...
  21. ---> 13:19:47 Initializing database ...
  22. ---> 13:19:47 Running mysql_install_db ...
  23. mkdir: cannot create directory '/var/lib/mysql/data': Permission denied
  24. Fatal error Can't create database directory '/var/lib/mysql/data'
  25.  
  26. The latest information about mysql_install_db is available at
  27. https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
  28. [student@linfuncent ~]$ podman rm mydbase
  29. 83ba4312ebacd9e185ff003253ec3c7f248fd412b00c316e8930a4df81924c55
  30. [student@linfuncent ~]$ sudo chown $(id -un) /opt/dfiles
  31. chown: cannot access '/opt/dfiles': No such file or directory
  32. [student@linfuncent ~]$ sudo chown $(id -un) /opt/dbfiles
  33. [student@linfuncent ~]$ podman run -d --name mydbase -v /opt/dbfiles:/var/lib/mysql:Z -e MYSQL_USER=user -e MYSQL_PASSWORD=password -e MYSQL_DATABASE=mydbase registry.redhat.io/rhel8/mariadb-103
  34. eab7a3b9ff5436e67256aea7955f8be96186ede921567bae8f7f19416178c8ad
  35. [student@linfuncent ~]$ podman ps
  36. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  37. eab7a3b9ff54 registry.redhat.io/rhel8/mariadb-103:latest run-mysqld 3 seconds ago Up 3 seconds ago mydbase
  38. [student@linfuncent ~]$ ls /opt/dbfiles/
  39. data mysql.sock
  40. [student@linfuncent ~]$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement