我正在尝试使用以下 Dockerfile 启动 ubuntu 映像:
FROM ubuntu/de:18.04
ARG MOSQUITTOVERSION
ENV MOSQUITTOVERSION 1.5.5
ENV DEBIAN_FRONTEND noninteractive
# Install System Utilities
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y libwrap0-dev libssl-dev python-distutils-extra \
libc-ares-dev uuid-dev
# Create Working Directory
RUN mkdir -p /usr/local/src
WORKDIR /usr/local/src
# Add MQQT Working Directory
RUN mkdir -p /mqtt/config /mqtt/data /mqtt/log
COPY config /mqtt/config
# Install MQQT Repository
RUN wget http://mosquitto.org/files/source/mosquitto-$MOSQUITTOVERSION.tar.gz
RUN tar xvzf ./mosquitto-$MOSQUITTOVERSION.tar.gz
WORKDIR /usr/local/src/mosquitto-$MOSQUITTOVERSION
RUN make && make install
RUN ldconfig
# Add User ( mosquitto )
RUN adduser --system --disabled-password --disabled-login mosquitto
USER mosquitto
RUN chown -R mosquitto:mosquitto /mqtt
VOLUME ["/mqtt/config", "/mqtt/data", "/mqtt/log"]
EXPOSE 1883 9001
ADD entrypoint.sh /usr/bin/
ENTRYPOINT ["entrypoint.sh"]
CMD ["/usr/sbin/mosquitto", "-c", "/mqtt/config/mosquitto.conf"]
当使用 进行构建时docker-compose build
,我得到了invalid Group: »mosquitto: mosquitto
。查看构建的一些输出:
Step 17/22 : RUN chown -R mosquitto:mosquitto /mqtt
---> Running in 827ca537e624
chown: ungültige Gruppe: »mosquitto:mosquitto“
The command '/bin/sh -c chown -R mosquitto:mosquitto /mqtt' returned a non-
zero code: 1