我有以下一行腳本:找不到ENVIROMENTAL參數
sudo env WORDPRESS_MYSQL_ROOT_PASSWORD="passwd" \
WORDPRESS_MYSQL_USER="wordpress" \
WORDPRESS_MYSQL_PASSWORD="wordpress" \
WORDPRESS_ADMIN_USER="admin" \
WORDPRESS_ADMIN_PASSWORD="admin" \
WORDPRESS_URL="http://0.0.0.0:8080" \
docker run \
--volume "/home/pcmagas/Kwdikas/docker/piwik-with-wordpress/scripts/../data/wordpress/db":/var/lib/mysql \
--volume /home/pcmagas/Kwdikas/docker/piwik-with-wordpress/scripts/../restore/wordpress/db:/docker-entrypoint-initdb.d \
-e MYSQL_ROOT_PASSWORD=$WORDPRESS_MYSQL_ROOT_PASSWORD \
-e MYSQL_DATABASE="wordpress" \
-e MYSQL_USER=$WORDPRESS_MYSQL_USER \
-e MYSQL_PASSWORD=$WORDPRESS_MYSQL_PASSWORD \
mariadb
但由於某些原因,我得到的錯誤:
error: 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
這意味着,由於某種原因,無法找到$WORDPRESS_MYSQL_ROOT_PASSWORD
ENVIROMENTAL參數。你能幫我解釋爲什麼嗎?
東西是'WORDPRESS_MYSQL_ROOT_PASSWORD'應該更換'MYSQL_ROOT_PASSWORD','MYSQL_ALLOW_EMPTY_PASSWORD'或'MYSQL_RANDOM_ROOT_PASSWORD'之一?您是否嘗試設置其中一個變量而不是'WORDPRESS_MYSQL_ROOT_PASSWORD'? – Ksyqo
否因爲我像這樣運行它以恢復https://github.com/ellakcy/piwik-with-wordpress的音量並使用相同的參數。 –