专属域名
文档搜索
轩辕助手
Run助手
邀请有礼
返回顶部
快速返回页面顶部
收起
收起工具栏

wordpress Docker 镜像 - 轩辕镜像

wordpress
library/wordpress
WordPress作为全球广泛使用的开源平台,是一款功能丰富的内容管理系统,它能够通过灵活运用各类插件、实用小工具及多样化主题,帮助用户轻松构建个性化网站、高效管理图文影音等各类内容,并根据需求自定义界面风格与功能模块,满足从个人博客到企业站点的不同场景应用需求。
5855 收藏0 次下载activelibrary镜像
🚀专业版镜像服务,面向生产环境设计
版本下载
🚀专业版镜像服务,面向生产环境设计

Quick reference

  • Maintained by:
    the Docker Community

  • Where to get help:
    the Docker Community Slack, Server Fault, Unix & Linux, or Stack Overflow

Supported tags and respective Dockerfile links

  • 6.9.0-php8.2-apache, 6.9-php8.2-apache, 6-php8.2-apache, php8.2-apache, 6.9.0-php8.2, 6.9-php8.2, 6-php8.2, php8.2

  • 6.9.0-php8.2-fpm, 6.9-php8.2-fpm, 6-php8.2-fpm, php8.2-fpm

  • 6.9.0-php8.2-fpm-alpine, 6.9-php8.2-fpm-alpine, 6-php8.2-fpm-alpine, php8.2-fpm-alpine

  • 6.9.0-apache, 6.9-apache, 6-apache, apache, 6.9.0, 6.9, 6, latest, 6.9.0-php8.3-apache, 6.9-php8.3-apache, 6-php8.3-apache, php8.3-apache, 6.9.0-php8.3, 6.9-php8.3, 6-php8.3, php8.3

  • 6.9.0-fpm, 6.9-fpm, 6-fpm, fpm, 6.9.0-php8.3-fpm, 6.9-php8.3-fpm, 6-php8.3-fpm, php8.3-fpm

  • 6.9.0-fpm-alpine, 6.9-fpm-alpine, 6-fpm-alpine, fpm-alpine, 6.9.0-php8.3-fpm-alpine, 6.9-php8.3-fpm-alpine, 6-php8.3-fpm-alpine, php8.3-fpm-alpine

  • 6.9.0-php8.4-apache, 6.9-php8.4-apache, 6-php8.4-apache, php8.4-apache, 6.9.0-php8.4, 6.9-php8.4, 6-php8.4, php8.4

  • 6.9.0-php8.4-fpm, 6.9-php8.4-fpm, 6-php8.4-fpm, php8.4-fpm

  • 6.9.0-php8.4-fpm-alpine, 6.9-php8.4-fpm-alpine, 6-php8.4-fpm-alpine, php8.4-fpm-alpine

  • 6.9.0-php8.5-apache, 6.9-php8.5-apache, 6-php8.5-apache, php8.5-apache, 6.9.0-php8.5, 6.9-php8.5, 6-php8.5, php8.5

  • 6.9.0-php8.5-fpm, 6.9-php8.5-fpm, 6-php8.5-fpm, php8.5-fpm

  • 6.9.0-php8.5-fpm-alpine, 6.9-php8.5-fpm-alpine, 6-php8.5-fpm-alpine, php8.5-fpm-alpine

  • cli-2.12.0-php8.2, cli-2.12-php8.2, cli-2-php8.2, cli-php8.2

  • cli-2.12.0, cli-2.12, cli-2, cli, cli-2.12.0-php8.3, cli-2.12-php8.3, cli-2-php8.3, cli-php8.3

  • cli-2.12.0-php8.4, cli-2.12-php8.4, cli-2-php8.4, cli-php8.4

  • cli-2.12.0-php8.5, cli-2.12-php8.5, cli-2-php8.5, cli-php8.5

Quick reference (cont.)

  • Where to file issues:
    [***]

  • Supported architectures: (more info)
    amd64, arm32v5, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x

  • Published image artifact details:
    repo-info repo's repos/wordpress/ directory (history)
    (image metadata, transfer size, etc)

  • Image updates:
    official-images repo's library/wordpress label
    official-images repo's library/wordpress file (history)

  • Source of this description:
    docs repo's wordpress/ directory (history)

What is WordPress?

WordPress is a free and open source blogging tool and a content management system (CMS) based on PHP and MySQL, which runs on a web hosting service. Features include a plugin architecture and a template system. WordPress is used by more than 22.0% of the top 10 million websites as of August 2013. WordPress is the most popular blogging system in use on the Web, at more than 60 million websites. The most popular languages used are English, Spanish and Bahasa Indonesia.

***.org/wiki/WordPress

!logo

How to use this image

console
$ docker run --name some-wordpress --network some-network -d wordpress

The following environment variables are also honored for configuring your WordPress instance (by a custom wp-config.php implementation):

  • -e WORDPRESS_DB_HOST=...
  • -e WORDPRESS_DB_USER=...
  • -e WORDPRESS_DB_PASSWORD=...
  • -e WORDPRESS_DB_NAME=...
  • -e WORDPRESS_TABLE_PREFIX=...
  • -e WORDPRESS_AUTH_KEY=..., -e WORDPRESS_SECURE_AUTH_KEY=..., -e WORDPRESS_LOGGED_IN_KEY=..., -e WORDPRESS_NONCE_KEY=..., -e WORDPRESS_AUTH_SALT=..., -e WORDPRESS_SECURE_AUTH_SALT=..., -e WORDPRESS_LOGGED_IN_SALT=..., -e WORDPRESS_NONCE_SALT=... (default to unique random SHA1s, but only if other environment variable configuration is provided)
  • -e WORDPRESS_DEBUG=1 (defaults to disabled, non-empty value will enable WP_DEBUG in wp-config.php)
  • -e WORDPRESS_CONFIG_EXTRA=... (defaults to nothing, the value will be evaluated by the eval() function in wp-config.php. This variable is especially useful for applying extra configuration values this image does not provide by default such as WP_ALLOW_MULTISITE; see docker-library/wordpress#142 for more details)

The WORDPRESS_DB_NAME needs to already exist on the given MySQL server; it will not be created by the wordpress container.

If you'd like to be able to access the instance from the host without the container's IP, standard port mappings can be used:

console
$ docker run --name some-wordpress -p 8080:80 -d wordpress

Then, access it via http://localhost:8080 or [***] in a browser.

When running WordPress with TLS behind a reverse proxy such as NGINX which is responsible for doing TLS termination, be sure to set X-Forwarded-Proto appropriately (see "Using a Reverse Proxy" in "Administration Over SSL" in upstream's documentation). No additional environment variables or configuration should be necessary (this image automatically adds the noted HTTP_X_FORWARDED_PROTO code to wp-config.php if any of the above-noted environment variables are specified).

If your database requires SSL, WordPress ticket #28625 has the relevant details regarding support for that with WordPress upstream. As a workaround, the "Secure DB Connection" plugin can be extracted into the WordPress directory and the appropriate values described in the configuration of that plugin added in wp-config.php.

Docker Secrets

As an alternative to passing sensitive information via environment variables, _FILE may be appended to the previously listed environment variables, causing the initialization script to load the values for those variables from files present in the container. In particular, this can be used to load passwords from Docker secrets stored in /run/secrets/<secret_name> files. For example:

console
$ docker run --name some-wordpress -e WORDPRESS_DB_PASSWORD_FILE=/run/secrets/mysql-root ... -d wordpress:tag

Currently, this is supported for WORDPRESS_DB_HOST, WORDPRESS_DB_USER, WORDPRESS_DB_PASSWORD, WORDPRESS_DB_NAME, WORDPRESS_AUTH_KEY, WORDPRESS_SECURE_AUTH_KEY, WORDPRESS_LOGGED_IN_KEY, WORDPRESS_NONCE_KEY, WORDPRESS_AUTH_SALT, WORDPRESS_SECURE_AUTH_SALT, WORDPRESS_LOGGED_IN_SALT, WORDPRESS_NONCE_SALT, WORDPRESS_TABLE_PREFIX, and WORDPRESS_DEBUG.

... via docker compose

Example compose.yaml for wordpress:

yaml
services:

  wordpress:
    image: wordpress
    restart: always
    ports:
      - 8080:80
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: exampleuser
      WORDPRESS_DB_PASSWORD: examplepass
      WORDPRESS_DB_NAME: exampledb
    volumes:
      - wordpress:/var/www/html

  db:
    image: mysql:8.0
    restart: always
    environment:
      MYSQL_DATABASE: exampledb
      MYSQL_USER: exampleuser
      MYSQL_PASSWORD: examplepass
      MYSQL_RANDOM_ROOT_PASSWORD: '1'
    volumes:
      - db:/var/lib/mysql

volumes:
  wordpress:
  db:

Run docker compose up, wait for it to initialize completely, and visit http://localhost:8080 or [***] (as appropriate).

Adding additional libraries / extensions

This image does not provide any additional PHP extensions or other libraries, even if they are required by popular plugins (e.g. it cannot send e-mails). There are an infinite number of possible plugins, and they potentially require any extension PHP supports. Including every PHP extension that exists would dramatically increase the image size.

If you need additional PHP extensions, you'll need to create your own image FROM this one. The documentation of the php image explains how to compile additional extensions. Additionally, an older Dockerfile for wordpress has a simplified example of doing this and a newer version of that same Dockerfile has a much more thorough example.

Include pre-installed themes / plugins

Mount the volume containing your themes or plugins to the proper directory; and then apply them through the "wp-admin" UI. Ensure read/write/execute permissions are in place for the user:

  • Themes go in a subdirectory in /var/www/html/wp-content/themes/
  • Plugins go in a subdirectory in /var/www/html/wp-content/plugins/

If you wish to provide additional content in an image for deploying in multiple installations, place it in the same directories under /usr/src/wordpress/ instead (which gets copied to /var/www/html/ on the container's initial startup).

Static image / updates-via-redeploy

The default configuration for this image matches the official WordPress defaults in which automatic updates are enabled (so the initial install comes from the image, but after that it becomes self-managing within the /var/www/html/ data volume).

If you wish to have a more static deployment (similar to other containerized applications) and deploy new containers to update WordPress + themes/plugins, then you'll want to use something like the following (and run the resulting image read-only):

dockerfile
FROM wordpress:apache
WORKDIR /usr/src/wordpress
RUN set -eux; \
	find /etc/apache2 -name '*.conf' -type f -exec sed -ri -e "s!/var/www/html!$PWD!g" -e "s!Directory /var/www/!Directory $PWD!g" '{}' +; \
	cp -s wp-config-docker.php wp-config.php
COPY custom-theme/ ./wp-content/themes/custom-theme/
COPY custom-plugin/ ./wp-content/plugins/custom-plugin/

For FPM-based images, remove the find instruction and adjust the SCRIPT_FILENAME paths in your reverse proxy from /var/www/html to /usr/src/wordpress.

Run the result read-only, providing writeable storage for /tmp, /run, and (optionally) wp-content/uploads:

console
$ docker run ... \
	--read-only \
	--tmpfs /tmp \
	--tmpfs /run \
	--mount type=...,src=...,dst=/usr/src/wordpress/wp-content/uploads \
	... \
	--env WORDPRESS_DB_HOST=... \
	--env WORDPRESS_AUTH_KEY=... \
	--env ... \
	custom-wordpress:tag

Note: be sure to rebuild and redeploy regularly to ensure you get all the latest WordPress security updates.

Running as an arbitrary user

See the "Running as an arbitrary user" section of the php image documentation.

When running WP-CLI via the cli variants of this image, it is important to note that they're based on Alpine, and have a default USER of Alpine's www-data, whose UID is 82 (compared to the Debian-based WordPress variants whose default effective UID is 33), so when running wordpress:cli against an existing Debian-based WordPress install, something like --user 33:33 is likely going to be necessary (possibly also something like -e HOME=/tmp depending on the wp command invoked and whether it tries to use ~/.wp-cli). See docker-library/wordpress#256 for more discussion around this.

Configuring PHP directives

See the "Configuration" section of the php image documentation.

For example, to adjust common php.ini flags like upload_max_filesize, you could create a custom.ini with the desired parameters and place it in the $PHP_INI_DIR/conf.d/ directory:

dockerfile
FROM wordpress:tag
COPY custom.ini $PHP_INI_DIR/conf.d/

Image Variants

The wordpress images come in many flavors, each designed for a specific use case.

wordpress:<version>

This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.

wordpress:<version>-fpm

This variant contains PHP's FastCGI Process Manager (FPM), which is the recommended FastCGI implementation for PHP.

In order to use this image variant, some kind of reverse proxy (such as NGINX, Apache, or other tool which speaks the FastCGI protocol) will be required.

Some potentially helpful resources:

  • FPM's Official Configuration Reference
  • Simplified example by @md5
  • Very detailed article by Pascal Landau
  • Stack Overflow discussion
  • Apache httpd Wiki example

WARNING: the FastCGI protocol is inherently trusting, and thus extremely insecure to expose outside of a private container network -- unless you know exactly what you are doing (and are willing to accept the extreme risk), do not use Docker's --publish (-p) flag with this image variant.

wordpress:cli

This image variant does not contain WordPress itself, but instead contains WP-CLI.

The simplest way to use it with an existing WordPress container would be something similar to the following:

console
$ docker run -it --rm \
	--volumes-from some-wordpress \
	--network container:some-wordpress \
	-e WORDPRESS_DB_USER=... \
	-e WORDPRESS_DB_PASSWORD=... \
	# [and other used environment variables]
	wordpress:cli user list

Generally speaking, for WP-CLI to interact with a WordPress install, it needs access to the on-disk files of the WordPress install, and access to the database (and the easiest way to accomplish that such that wp-config.php does not require changes is to simply join the networking context of the existing and presumably working WordPress container, but there are many other ways to accomplish that which will be left as an exercise for the reader).

NOTE: Since March 2021, WordPress images use a customized wp-config.php that pulls the values directly from the environment variables defined above (see wp-config-docker.php in docker-library/wordpress#572 and docker-library/wordpress#577). As a result of reading environment variables directly, the cli container also needs the same set of environment variables to properly evaluate wp-config.php.

License

View license information for the software contained in this image.

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

Some additional license information which was able to be auto-detected might be found in the repo-info repository's wordpress/ directory.

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.

Deployment & Usage Documentation

Docker 部署 WordPress 全流程教程

WordPress 是全球最流行的开源内容管理系统(CMS),基于 PHP + MySQL 架构,截至目前,全球超过 43% 的网站使用 WordPress 构建,从个人博客到大型媒体平台(如《纽约时报》部分栏目)均有应用,是入门建站和快速迭代业务的首选工具。

Read More
查看更多 wordpress 相关镜像 →
bitnami/wordpress logo
bitnami/wordpress
by VMware
认证
Bitnami Secure Image for WordPress是由Bitnami提供的适用于WordPress的安全优化镜像,其集成预配置的安全防护设置、自动漏洞更新机制、SSL证书支持及基础防火墙功能,可有效降低恶意攻击与数据泄露风险,同时优化服务器资源分配与运行性能,确保WordPress网站快速稳定部署,且兼容主流云平台与本地服务器环境,为用户提供开箱即用的安全可靠建站解决方案。
281100M+ pulls
上次更新:30 天前
bitnamicharts/wordpress logo
bitnamicharts/wordpress
by VMware
认证
Bitnami提供的WordPress Helm Chart,用于在Kubernetes环境中简化WordPress的部署与管理。
21M+ pulls
上次更新:23 天前
elestio/wordpress logo
elestio/wordpress
by Elestio
认证
Elestio验证并打包的WordPress,是用于搭建网站的内容管理系统。
610K+ pulls
上次更新:6 天前
secoresearch/wordpress logo
secoresearch/wordpress
by secoresearch
集成Apache、PHP、Varnish和WordPress的Docker镜像,用于快速部署高性能WordPress网站,Varnish提供缓存加速以提升访问速度和系统响应能力。
100K+ pulls
上次更新:4 个月前
shinsenter/wordpress logo
shinsenter/wordpress
by SHIN Company
基于PHP的Wordpress生产就绪Docker镜像,具备自动Wordpress安装功能。
5100K+ pulls
上次更新:7 天前
chainguard/wordpress logo
chainguard/wordpress
by Chainguard, Inc.
认证
使用Chainguard的低至零CVE容器镜像构建、交付和运行安全软件。
10K+ pulls
上次更新:6 天前

轩辕镜像配置手册

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式

登录仓库拉取

通过 Docker 登录认证访问私有仓库

Linux

在 Linux 系统配置镜像服务

Windows/Mac

在 Docker Desktop 配置镜像

Docker Compose

Docker Compose 项目配置

K8s Containerd

Kubernetes 集群配置 Containerd

K3s

K3s 轻量级 Kubernetes 镜像加速

宝塔面板

在宝塔面板一键配置镜像

群晖

Synology 群晖 NAS 配置

飞牛

飞牛 fnOS 系统配置镜像

极空间

极空间 NAS 系统配置服务

爱快路由

爱快 iKuai 路由系统配置

绿联

绿联 NAS 系统配置镜像

威联通

QNAP 威联通 NAS 配置

Podman

Podman 容器引擎配置

Singularity/Apptainer

HPC 科学计算容器配置

其他仓库配置

ghcr、Quay、nvcr 等镜像仓库

专属域名拉取

无需登录使用专属域名

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

轩辕镜像免费版与专业版有什么区别?

免费版仅支持 Docker Hub 访问,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。

轩辕镜像支持哪些镜像仓库?

专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等;免费版仅支持 docker.io。

流量耗尽错误提示

当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。

410 错误问题

通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。

manifest unknown 错误

先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。

镜像拉取成功后,如何去掉轩辕镜像域名前缀?

使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

oldzhang的头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
library/wordpress
官方博客Docker 镜像使用技巧与技术博客
热门镜像查看热门 Docker 镜像推荐
一键安装一键安装 Docker 并配置镜像源
提交工单
免费获取在线技术支持请 提交工单,官方QQ群:13763429 。
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
免费获取在线技术支持请提交工单,官方QQ群: 。
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
官方邮箱:点击复制邮箱
©2024-2026 源码跳动
官方邮箱:点击复制邮箱Copyright © 2024-2026 杭州源码跳动科技有限公司. All rights reserved.
轩辕镜像 官方专业版 Logo
轩辕镜像轩辕镜像官方专业版
首页个人中心搜索镜像
交易
充值流量我的订单
工具
提交工单镜像收录一键安装
Npm 源Pip 源Homebrew 源
帮助
常见问题
其他
关于我们网站地图

官方QQ群: 13763429