6 Star 42 Fork 11

Gitee 极速下载/BifroMQ

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/baidu/bifromq
克隆/下载
Dockerfile 1.62 KB
一键复制 编辑 原始数据 按行查看 历史
Yonny Hao 提交于 2024-05-23 23:05 . fix docker build for Linux/amd64
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"]
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/mirrors/BifroMQ.git
git@gitee.com:mirrors/BifroMQ.git
mirrors
BifroMQ
BifroMQ
main

搜索帮助