这是我的dockerfile
FROM microsoft/windowsservercore
# rabbitmq version used in download url and to rename folder extracted from
zip file
ENV rabbitmq_version "3.6.11"
#download erlang and RabbitMQ
ADD "http://erlang.org/download/otp_win64_19.3.exe" "erlang_install.exe"
ADD "https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.11/rabbitmq-
server-windows-3.6.11.zip" "rabbitmq.zip"
# erlang will install to this location and rabbitmq will use this
environment variable to locate it
ENV ERLANG_HOME c:\\erlang
# setup powershell options for RUN commands
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';
$ProgressPreference = 'SilentlyContinue';"]
# install erlang using silent install option, and remove installer when done
RUN Start-Process -Wait -FilePath .\erlang_install.exe -ArgumentList /S,
/D=$env:ERLANG_HOME ; \
Remove-Item -Force erlang_install.exe
# extract rabbitmq, and remove zip file when done
RUN Expand-Archive -Path .\rabbitmq.zip -DestinationPath "c:\\" ; \
Remove-Item -Force rabbitmq.zip
# remove version from rabbitmq folder name
RUN Rename-Item c:\rabbitmq_server-$env:rabbitmq_version c:\rabbitmq
# enable managment plugin
RUN c:\rabbitmq\sbin\rabbitmq-plugins.bat enable rabbitmq_management --
offline
# tell rabbitmq where to find our custom config file
ENV RABBITMQ_CONFIG_FILE "c:\rabbitmq"
RUN ["cmd", "/c", "echo [{rabbit, [{loopback_users, []}]}].>
c:\\rabbitmq.config"]
EXPOSE 15672
EXPOSE 5672
# run server when container starts - container will shut down when this
process ends
CMD "c:\rabbitmq\sbin\rabbitmq-server.bat"
当容器在我的Windows 10机器上启动时,需要5-10分钟才能看到实际的代理在日志中启动。我也无法访问管理门户,在代理启动之前,没有任何应用可以连接。 有没有办法让经纪人更快地开始?它不会在Linux容器上执行此操作
答案 0 :(得分:0)
当容器在我的Windows 10机器上启动时,需要5到10分钟才能看到实际的代理在日志中启动。
每次容器启动时,您都会从头开始安装Erlang(erlang_install.exe
)。
您尝试过哪种Linux容器没有出现此问题?它是否已经开箱即用了RabbitMQ?你可以使用预先安装了RabbitMQ的Windows容器,或者自己创建一个可以重复使用的容器映像吗?