容器化部署关于挂载自动生成配置文件若干

1.你好,我使用了docker-compose成功创建了emqx容器如下所示:
services:
emqx:
container_name: emqx
image: emqx/emqx:5.5.1
deploy:
resources:
limits:
cpus: ${CPUS}
memory: ${MEMORY_LIMIT}
ports:
- ${HOST_IP}:${PORT_HTTP}:18083
- ${HOST_IP}:${EMQX_PORT_1883}:1883
- ${HOST_IP}:${EMQX_PORT_8083}:8083
- ${HOST_IP}:${EMQX_PORT_8084}:8084
- ${HOST_IP}:${EMQX_PORT_8883}:8883
restart: always
user: “0”
volumes:
- ./data:/opt/emqx/data
- ./log:/opt/emqx/log
version: “3”

2.目录结构如下:
image
image

并且上面的2个目录以及文件是自动生成的,请问是做到自动生成的

我也拜读了,这份dockerfile,奈何没太明白

This is a fast-build Dockerfile only for testing

FROM ubuntu:20.04@sha256:f2034e7195f61334e6caff6ecf2e965f92d11e888309065da85ff50c617732b8
ARG PROFILE=emqx

RUN apt-get update;
apt-get install -y --no-install-recommends ca-certificates procps;
rm -rf /var/lib/apt/lists/*

RUN mkdir /opt/emqx
RUN date > /opt/emqx/BUILD_TIME
COPY _build/${PROFILE}/rel/emqx /opt/emqx
RUN ln -s /opt/emqx/bin/* /usr/local/bin/
COPY deploy/docker/docker-entrypoint.sh /usr/bin/

WORKDIR /opt/emqx

RUN groupadd -r -g 1000 emqx;
useradd -r -m -u 1000 -g emqx emqx;
chgrp -Rf emqx /opt/emqx;
chmod -Rf g+w /opt/emqx;
chown -Rf emqx /opt/emqx

USER emqx

VOLUME [“/opt/emqx/log”, “/opt/emqx/data”]

emqx will occupy these port:

- 1883 port for MQTT

- 8083 for WebSocket/HTTP

- 8084 for WSS/HTTPS

- 8883 port for MQTT(SSL)

- 18083 for dashboard and API

- 4370 default Erlang distrbution port

- 5369 for backplain gen_rpc

EXPOSE 1883 8083 8084 8883 18083 4370 5369

ENTRYPOINT [“/usr/bin/docker-entrypoint.sh”]

CMD [“/opt/emqx/bin/emqx”, “foreground”]

这个句子我没读懂,不知道什么意思 ,现在遇到什么问题么?

就是为啥会自动生成文件

我并没有手动创建

如果说的是docker,下载下来的image里面已经有这 2 个目录 了。

如果不是 docker 安装,就可以用配置项指定:
程序启动时会自动生成:

node {  
  data_dir = "data"
}
log.file.default {     
      path = "log"
}