代码拉取完成,页面将自动刷新
ARG BASE_IMAGE=debian:buster-slim
FROM --platform=$TARGETPLATFORM ${BASE_IMAGE} AS builder
ARG TARGETPLATFORM
# Install necessary tools for diagnostics and JDK download
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl net-tools lsof netcat procps less \
&& if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
export JDK_ARCH=x64; \
else \
export JDK_ARCH=aarch64; \
fi \
&& echo "JDK_ARCH is set to ${JDK_ARCH}" \
&& curl --retry 5 -S -L -O https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2_linux-${JDK_ARCH}_bin.tar.gz \
&& tar -zxvf openjdk-17.0.2_linux-${JDK_ARCH}_bin.tar.gz \
&& rm -rf openjdk-17.0.2_linux-${JDK_ARCH}_bin.tar.gz \
&& rm -rf /var/lib/apt/lists/*
COPY bifromq-*-standalone.tar.gz /
RUN mkdir /bifromq && tar -zxvf /bifromq-*-standalone.tar.gz --strip-components 1 -C /bifromq \
&& rm -rf /bifromq-*-standalone.tar.gz
FROM --platform=$TARGETPLATFORM ${BASE_IMAGE}
RUN groupadd -r -g 1000 bifromq \
&& useradd -r -m -u 1000 -g bifromq bifromq \
&& apt-get update \
&& apt-get install -y --no-install-recommends net-tools lsof netcat procps less \
&& rm -rf /var/lib/apt/lists/*
COPY --chown=bifromq:bifromq --from=builder /jdk-17.0.2 /usr/share/jdk-17.0.2
COPY --chown=bifromq:bifromq --from=builder /bifromq /home/bifromq/
ENV JAVA_HOME /usr/share/jdk-17.0.2
ENV PATH /usr/share/jdk-17.0.2/bin:$PATH
WORKDIR /home/bifromq
USER bifromq
# Set common command aliases
RUN echo "alias ll='ls -al'" >> ~/.bashrc
EXPOSE 1883 1884 80 443
CMD ["./bin/standalone.sh", "start", "-fg"]
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。