
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
!https://img.shields.io/docker/cloud/build/rroemhild/ejabberd !https://img.shields.io/docker/stars/rroemhild/ejabberd.svg !https://img.shields.io/docker/pulls/rroemhild/ejabberd.svg
Dockerfile to build an ejabberd container image.
Since version 16.12, ejabberd has it's own docker container based on the work of this container included in the source tree. See more in this blogpost. We can expect more work on this in the future.
Current Version: 21.01
Docker Tag Names are based on ejabberd versions in git https://github.com/rroemhild/docker-ejabberd/branches and https://github.com/rroemhild/docker-ejabberd/tags. The image tag :latest is based on the master branch.
You can start of with the following container:
bashdocker run -d \ --name "ejabberd" \ -p 5222:5222 \ -p 5269:5269 \ -p 5280:5280 \ -h 'xmpp.example.de' \ -e "XMPP_DOMAIN=example.de" \ -e "EJABBERD_ADMINS=admin@example.de admin2@example.de" \ -e "EJABBERD_USERS=admin@example.de:password1234 admin2@example.de" \ -e "TZ=Europe/Berlin" \ rroemhild/ejabberd
or with the docker-compose example
bashwget https://raw.githubusercontent.com/rroemhild/docker-ejabberd/master/examples/docker-compose/docker-compose.yml docker-compose up
For storage of the application data, you can mount volumes at
/opt/ejabberd/ssl/opt/ejabberd/backup/opt/ejabberd/upload/opt/ejabberd/databaseor use a data container
bashdocker create --name ejabberd-data rroemhild/ejabberd-data docker run -d --name ejabberd --volumes-from ejabberd-data rroemhild/ejabberd
TLS is enabled by default and the run script will auto-generate two snake-oil certificates during boot if you don't provide your SSL certificates.
To use your own certificates, there are two options.
Mount the volume /opt/ejabberd/ssl to a local directory with the .pem files:
Make sure that the certificate and private key are in one .pem file. If one file is missing it will be auto-generated. I.e. you can provide your certificate for your XMMP_DOMAIN and use a snake-oil certificate for the SERVER_HOSTNAME.
Specify the certificates via environment variables: EJABBERD_SSLCERT_HOST and EJABBERD_SSLCERT_EXAMPLE_COM. For the domain certificates, make sure you match the domain names given in XMPP_DOMAIN and replace dots and dashes with underscore.
Build your own ejabberd container image and add your config templates, certificates or extend it for your needs.
FROM rroemhild/ejabberd ADD ./ejabberd.yml.tpl /opt/ejabberd/conf/ejabberd.yml.tpl ADD ./ejabberdctl.cfg.tpl /opt/ejabberd/conf/ejabberdctl.cfg.tpl ADD ./example.com.pem /opt/ejabberd/ssl/example.com.pem
If you need root privileges switch to USER root and go back to USER ejabberd when you're done.
By default ejabberd runs as user ejabberd(999). To run ejabberd as root add the -u root argument to docker run.
bashdocker run -d -u root -P rroemhild/ejabberd
The docker-compose-cluster example demonstrates how to extend this container image to setup a multi-master cluster.
You can additionally provide extra runtime configuration in a downstream image by replacing the config template ejabberd.yml.tpl with one based on this image's template and include extra interpolation of environment variables. The template is parsed by Jinja2 with the runtime environment (equivalent to Python's os.environ available as env).
By default the container will serve the XMPP domain localhost. In order to serve a different domain at runtime, provide the XMPP_DOMAIN variable with a domain name. You can add more domains separated with whitespace.
XMPP_DOMAIN=example.ninja xyz.io test.com
Authentication methods can be set with the EJABBERD_AUTH_METHOD environment variable. The default authentication mode is internal.
Supported authentication methods:
Internal and anonymous authentication example:
EJABBERD_AUTH_METHOD=internal anonymous
External authentication example:
EJABBERD_AUTH_METHOD=external EJABBERD_EXTAUTH_PROGRAM="/opt/ejabberd/scripts/authenticate-user.sh" EJABBERD_EXTAUTH_INSTANCES=3 EJABBERD_EXTAUTH_CACHE=600
EJABBERD_EXTAUTH_INSTANCES must be an integer with a minimum value of 1. EJABBERD_EXTAUTH_CACHE can be set to "false" or an integer value representing cache time in seconds. Note that caching should not be enabled if internal auth is also enabled.
The variable EJABBERD_AUTH_PASSWORD_FORMAT controls in which format user passwords are
stored. Possible values are plain and scram. The default is to store
SCRAMbled
passwords, meaning that it is impossible to obtain the original plain password from the
stored information.
NOTE: SCRAM does not work with SIP/TURN foreign authentication methods. In this case, you may have to disable the option. More details can be found here: [***]
If using SCRAM with an SQL database that has plaintext passwords stored, use the command
ejabberdctl convert_to_scram example.org
to convert all your existing plaintext passwords to scrambled format.
Set EJABBERD_AUTH_METHOD=external and EJABBERD_EXTAUTH_PROGRAM=/opt/ejabberd/scripts/lib/auth_mysql.py to enable MySQL authentication. Use the following environment variables to configure the database connection and the layout of the database. Password changing, registration, and unregistration are optional features and are enabled only if the respective queries are provided.
crypt, md5, sha1, sha224, sha256, sha384, sha512. crypt is recommended, as it is salted. When setting the password, crypt uses SHA-512 (prefix `$6# rroemhild/ejabberd!https://img.shields.io/docker/cloud/build/rroemhild/ejabberd !https://img.shields.io/docker/stars/rroemhild/ejabberd.svg !https://img.shields.io/docker/pulls/rroemhild/ejabberd.svg
Dockerfile to build an ejabberd container image.
Since version 16.12, ejabberd has it's own docker container based on the work of this container included in the source tree. See more in this blogpost. We can expect more work on this in the future.
Current Version: 21.01
Docker Tag Names are based on ejabberd versions in git https://github.com/rroemhild/docker-ejabberd/branches and https://github.com/rroemhild/docker-ejabberd/tags. The image tag :latest is based on the master branch.
You can start of with the following container:
bashdocker run -d \ --name "ejabberd" \ -p 5222:5222 \ -p 5269:5269 \ -p 5280:5280 \ -h 'xmpp.example.de' \ -e "XMPP_DOMAIN=example.de" \ -e "EJABBERD_ADMINS=admin@example.de admin2@example.de" \ -e "EJABBERD_USERS=admin@example.de:password1234 admin2@example.de" \ -e "TZ=Europe/Berlin" \ rroemhild/ejabberd
or with the docker-compose example
bashwget https://raw.githubusercontent.com/rroemhild/docker-ejabberd/master/examples/docker-compose/docker-compose.yml docker-compose up
For storage of the application data, you can mount volumes at
/opt/ejabberd/ssl/opt/ejabberd/backup/opt/ejabberd/upload/opt/ejabberd/databaseor use a data container
bashdocker create --name ejabberd-data rroemhild/ejabberd-data docker run -d --name ejabberd --volumes-from ejabberd-data rroemhild/ejabberd
TLS is enabled by default and the run script will auto-generate two snake-oil certificates during boot if you don't provide your SSL certificates.
To use your own certificates, there are two options.
Mount the volume /opt/ejabberd/ssl to a local directory with the .pem files:
Make sure that the certificate and private key are in one .pem file. If one file is missing it will be auto-generated. I.e. you can provide your certificate for your XMMP_DOMAIN and use a snake-oil certificate for the SERVER_HOSTNAME.
Specify the certificates via environment variables: EJABBERD_SSLCERT_HOST and EJABBERD_SSLCERT_EXAMPLE_COM. For the domain certificates, make sure you match the domain names given in XMPP_DOMAIN and replace dots and dashes with underscore.
Build your own ejabberd container image and add your config templates, certificates or extend it for your needs.
FROM rroemhild/ejabberd ADD ./ejabberd.yml.tpl /opt/ejabberd/conf/ejabberd.yml.tpl ADD ./ejabberdctl.cfg.tpl /opt/ejabberd/conf/ejabberdctl.cfg.tpl ADD ./example.com.pem /opt/ejabberd/ssl/example.com.pem
If you need root privileges switch to USER root and go back to USER ejabberd when you're done.
By default ejabberd runs as user ejabberd(999). To run ejabberd as root add the -u root argument to docker run.
bashdocker run -d -u root -P rroemhild/ejabberd
The docker-compose-cluster example demonstrates how to extend this container image to setup a multi-master cluster.
You can additionally provide extra runtime configuration in a downstream image by replacing the config template ejabberd.yml.tpl with one based on this image's template and include extra interpolation of environment variables. The template is parsed by Jinja2 with the runtime environment (equivalent to Python's os.environ available as env).
By default the container will serve the XMPP domain localhost. In order to serve a different domain at runtime, provide the XMPP_DOMAIN variable with a domain name. You can add more domains separated with whitespace.
XMPP_DOMAIN=example.ninja xyz.io test.com
Authentication methods can be set with the EJABBERD_AUTH_METHOD environment variable. The default authentication mode is internal.
Supported authentication methods:
Internal and anonymous authentication example:
EJABBERD_AUTH_METHOD=internal anonymous
External authentication example:
EJABBERD_AUTH_METHOD=external EJABBERD_EXTAUTH_PROGRAM="/opt/ejabberd/scripts/authenticate-user.sh" EJABBERD_EXTAUTH_INSTANCES=3 EJABBERD_EXTAUTH_CACHE=600
EJABBERD_EXTAUTH_INSTANCES must be an integer with a minimum value of 1. EJABBERD_EXTAUTH_CACHE can be set to "false" or an integer value representing cache time in seconds. Note that caching should not be enabled if internal auth is also enabled.
The variable EJABBERD_AUTH_PASSWORD_FORMAT controls in which format user passwords are
stored. Possible values are plain and scram. The default is to store
SCRAMbled
passwords, meaning that it is impossible to obtain the original plain password from the
stored information.
NOTE: SCRAM does not work with SIP/TURN foreign authentication methods. In this case, you may have to disable the option. More details can be found here: [***]
If using SCRAM with an SQL database that has plaintext passwords stored, use the command
ejabberdctl convert_to_scram example.org
to convert all your existing plaintext passwords to scrambled format.
Set EJABBERD_AUTH_METHOD=external and EJABBERD_EXTAUTH_PROGRAM=/opt/ejabberd/scripts/lib/auth_mysql.py to enable MySQL authentication. Use the following environment variables to configure the database connection and the layout of the database. Password changing, registration, and unregistration are optional features and are enabled only if the respective queries are provided.
crypt, md5, sha1, sha224, sha256, sha384, sha512. crypt is recommended, as it is salted. When setting the password, crypt uses SHA-512 (prefix ).%(user)s, %(host)s. Example: SELECT password FROM users WHERE username = CONCAT(%(user)s, '@', %(host)s)%(password)s contains the hashed password. Example: UPDATE users SET password = %(password)s WHERE username = CONCAT(%(user)s, '@', %(host)s)INSERT INTO users ( username, password ) VALUES ( CONCAT(%(user)s, '@', %(host)s), %(password)s )DELETE FROM users WHERE username = CONCAT(%(user)s, '@', %(host)s)Note that the MySQL authentication script writes a debug log into the file /var/log/ejabberd/extauth.log. To get its content, execute the following command:
bashdocker exec -ti ejabberd tail -n50 -f /var/log/ejabberd/extauth.log
To find out more about the mysql authentication script, check out the https://github.com/rankenstein/ejabberd-auth-mysql repository.
Full documentation [***]
Connection
tls enables encryption by using LDAP over SSL. The default value is: none.false|soft|hard This option specifies whether to verify LDAP server certificate or not when TLS is enabled. The default is false which means no checks are performed.389 if encryption is disabled; and 636 if encryption is enabled.never|always|finding|searching
Whether or not to dereference aliases. The default is never.Authentication
ldap_uidattr:ldap_uidattr_format The default attributes are uid:%u.{ Filter: FilterAttrs } This filter is applied on the results returned by the main filter. By default ldap_dn_filter is undefined.Set one or more admin user (seperated by whitespace) with the EJABBERD_ADMINS environment variable. You can register admin users with the EJABBERD_USERS environment variable during container startup, use you favorite XMPP client or the ejabberdctl command line utility.
EJABBERD_ADMINS=admin@example.ninja
Automatically register users during container startup. Uses random password if you don't provide a password for the user. Format is JID:PASSWORD. Register more users separated with whitespace.
Register the admin user from EJABBERD_ADMINS with a give password:
EJABBERD_USERS=admin@example.ninja:password1234
Or without a random password printed to stdout (check container logs):
EJABBERD_USERS=admin@example.ninja
Register more than one user:
EJABBERD_USERS=admin@example.ninja:password1234 user1@test.com user1@xyz.io
Automatically create roster groups and register users during container startup. To create shared roster groups, separate with whitespace:
EJABBERD_GROUPS=group1@example.ninja group2@test.com
To add users to shared roster groups, separate with whitespace:
EJABBERD_GROUP_MEMBERS=admin@example.ninja:group1@example.ninja user1@test.com:group2@test.com
To add all registered users on a virtual host to a shared roster group:
EJABBERD_GROUP_MEMBERS=@all@@example.ninja:group1@example.ninja
Please take a note of the format: @all@@example.ninja. You need to specify not only the special directive @all@ but also a virtual host separated by @.
false to disable StartTLS for client to server connections. Defaults
to true.false to disable SSL in server 2 server connections. Defaults to true.true.false.true.HIGH:!aNULL:!3DES.true to use or generate custom DH parameters. Defaults to false.ejabberd lets erlang add the hostname. Defaults to ejabberd@localhost.false.false.false.true.false.true.true.Use the EJABBERD_LOGLEVEL environment variable to set verbosity. Defaults to 4 (Info).
loglevel: Verbosity of log files generated by ejabberd. 0: No ejabberd log at all (not recommended) 1: Critical 2: Error 3: Warning 4: Info 5: Debug
If you prefer to use your own configuration files and avoid passing docker environment variables (-e), you can do so by mounting a host directory.
Pass in an additional -v to the docker run command, like so:
docker run -d \ --name "ejabberd" \ -p 5222:5222 \ -p 5269:5269 \ -p 5280:5280 \ -h 'xmpp.example.de' \ -v /<host_path>/conf:/opt/ejabberd/conf \ rroemhild/ejabberd
Your /<host_path>/conf folder should look like so:
/<host_path>/conf/ ├── ejabberdctl.cfg ├── ejabberd.yml └── inetrc
Example configuration files can be downloaded from the ejabberd https://github.com/processone/ejabberd page.
When these files exist in /opt/ejabberd/conf, the run script will ignore the configuration templates.
You may use MySQL as a default database for all module that supports MySQL.
true to enable ODBC pluginmysqlsql to enable storing authentication using MySQL Auth internal implementation.The ejabberdctl command is in the search path and can be run by:
bashdocker exec CONTAINER ejabberdctl help
bashdocker exec CONTAINER ejabberdctl register user XMPP_DOMAIN PASSWORD
Create a backupfile with ejabberdctl and copy the file from the container to localhost
bashdocker exec CONTAINER ejabberdctl backup /opt/ejabberd/backup/ejabberd.backup docker cp CONTAINER:/opt/ejabberd/backup/ejabberd.backup /tmp/ejabberd.backup
Copy the backupfile from localhost to the running container and restore with ejabberdctl
bashdocker cp /tmp/ejabberd.backup CONTAINER:/opt/ejabberd/backup/ejabberd.backup docker exec CONTAINER ejabberdctl restore /opt/ejabberd/backup/ejabberd.backup
Set -i and -t option and append live to get an interactive erlang shell:
bashdocker run -i -t -P rroemhild/ejabberd live
You can terminate the erlang shell with q()..
bashdocker run -i -t rroemhild/ejabberd shell
bashdocker run -i -t rroemhild/ejabberd env
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务