wordpress - 图像构建后安装 wp 插件
问题描述
我正在尝试通过在构建 wordpress 图像后立即执行脚本来安装 wp 插件。
这是我的 Dockerfile:
FROM wordpress
# Update aptitude with new repo
RUN apt-get update
# Install software
RUN apt-get install -y sudo vim curl less git python-dev python3.5
# Add WP-CLI
RUN curl -o /bin/wp-cli.phar https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
COPY wp-su.sh /bin/wp
RUN chmod +x /bin/wp-cli.phar /bin/wp && chown www-data:www-data /bin/wp-cli.phar /bin/wp
# Copy scripts into the image
COPY install.py /usr/src/wordpress
COPY plugins.json /usr/src/wordpress
COPY wait-for-it.sh /usr/src/wordpress
RUN chmod +x /usr/src/wordpress/install.py
RUN chmod +x /usr/src/wordpress/plugins.json
RUN chmod +x /usr/src/wordpress/wait-for-it.sh
COPY --chown=www-data:www-data uploads/ /usr/src/wordpress/wp-content/uploads
# Cleanup
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENTRYPOINT ["/usr/src/wordpress/wait-for-it.sh", "db:3306", "--", "python" , "/usr/src/wordpress/install.py" ]
CMD ["apache2-foreground"]
脚本运行后,我收到以下错误:
Error: This does not seem to be a WordPress installation.
Pass --path=`path/to/wordpress` or run `wp core download`.
我尝试按照错误提示进行操作,但没有成功。据我了解,wordpress 安装应该/usr/src/wordpress
与我复制到其中的所有脚本一起放置。我在做什么正确吗?是否有可能做我正在尝试的事情?任何帮助,将不胜感激。
注意:此图像是从 docker-compose.yml 运行的
更新:
在我看来,上述错误的原因是因为尚未安装 wordpress,并且通过指定入口点,我认为我正在覆盖官方 wp 图像提供的入口点,其中 wordpress 安装被复制到 /运行时的 var/www/html 目录。不知道如何解决这个问题。
解决方案
推荐阅读
- amazon-web-services - Dynamodb 跨账户 put_item
- c# - 视图不从控制器返回
- php - (已关闭)将字符串列表转换为 Json 数组
- react-native - Restify 后端 API,React-native 应用 oauth2 授权
- jquery - 带有 Enter 键的 DataTabley KeyTable 导航
- facebook - Spark AR 目标跟踪器
- c++ - 使用带有特征的 pardiso 求解器
- javascript - Firebase Cloud Function - Promises:可以添加到 Promise.all() 的“承诺”数量是否有任何限制?
- javascript - 如何根据某些条件在新的 aspx 页面中获取共享点列表项
- ios - 模拟器中的视图与视图层次结构中的框架不同