试图理解用bash编写的dockerfile。什么:为了什么?
: ${WORDPRESS_DB_USER:=root}
:=呢?
我从脚本中添加了更多代码以供参考:
#!/bin/bash
set -e
if [ -n "$MYSQL_PORT_3306_TCP" ]; then
if [ -z "$WORDPRESS_DB_HOST" ]; then
WORDPRESS_DB_HOST='mysql'
else
echo >&2 'warning: both WORDPR
我正在尝试创建一个数据库,如果数据库不存在,并设置privledges,但是我很难让它工作,我一直在获取You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci' at line 1
我已经包括了执行命令的各种方法
Yaml:
initContainer
我有这个码头文件
services:
db:
# We use a mariadb image which supports both amd64 & arm64 architecture
image: mariadb:10.6.4-focal
# If you really want to use MySQL, uncomment the following line
#image: mysql:8.0.27
command: '--default-authentication-plugin=mysql_native_passwor