popduke commented on code in PR #29: URL: https://github.com/apache/bifromq-sites/pull/29#discussion_r2579605129
########## docs/installation/docker.md: ########## @@ -6,33 +6,97 @@ title: "Docker" ## Prerequisites * [Docker](https://www.docker.com/) is installed. -* You have permission to use port 1883, and the port are available. If you do not have permission, please change to the corresponding port. +* You have permission to use port 1883, and the port is available. If you do not have permission, please change to the corresponding port. ## Docker Command -Run the following command, which will run BifroMQ within a container as the Linux user `bifromq`. +Run the following command, which will run Apache BifroMQ within a container as the Linux user `bifromq`. ``` -docker run -d --name bifromq -p 1883:1883 bifromq/bifromq:latest +docker run -d --name bifromq -p 1883:1883 apache/bifromq:4.0.0-incubating ``` ## Memory Constraints -By default, upon BifroMQ process initiation, it dynamically computes the relevant JVM parameters based on the physical memory of the hosting server. However, when launched within a containerized environment, it introspects the host +By default, upon Apache BifroMQ process initiation, it dynamically computes the relevant JVM parameters based on the physical memory of the hosting server. However, when launched within a containerized environment, it introspects the host machine's physical memory, potentially causing conflicts with Docker or container-imposed memory constraints, consequently leading to the premature termination of the container. To circumvent such challenges, it is advisable to proactively delimit the container's memory consumption and convey these limitations to the container runtime via environmental variables. During the startup of BifroMQ, priority is given to the calculation of JVM parameters based on the `MEM_LIMIT` environmental variable. A specific illustration is provided below: ``` -docker run -d -m 10G -e MEM_LIMIT='10737418240' --name bifromq -p 1883:1883 bifromq/bifromq:latest +docker run -d -m 10G -e MEM_LIMIT='10737418240' --name bifromq -p 1883:1883 apache/bifromq:4.0.0-incubating ``` ***Note: The unit of MEM_LIMIT is in bytes.*** Going a step further, it is possible to proactively configure the JVM heap memory and directly transmit it to the container runtime for utilization by BifroMQ. A specific illustration is provided below: ``` -docker run -d -m 10G -e JVM_HEAP_OPTS='-Xms2G -Xmx4G -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=500m -XX:MaxDirectMemorySize=1G' --name bifromq -p 1883:1883 bifromq/bifromq:latest +docker run -d -m 10G -e JVM_HEAP_OPTS='-Xms2G -Xmx4G -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=500m -XX:MaxDirectMemorySize=1G' --name bifromq -p 1883:1883 apache/bifromq:4.0.0-incubating Review Comment: Maybe the version number could be centrally managed by `releaseInfo.ts` introduced in last commit -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
