Multi Platform Builds Docker
April 9, 2025 · 2 min read · Page View:
This is a viable build record. The multi platform builds are supported by docker buildx
1, which is related to binfmt_misc
and QEMU
.
This is a viable build record. The multi platform builds are supported by docker buildx
1, which is related to binfmt_misc
and QEMU
.
Normally, we often write a Dockerfile
in the current directory.
Dockerfile
is a configuration file that describes how to build the image. You can refer to the official documentation for more details.CMD
, only the last one takes effect. So if you have multiple commands to run, you better write them in a script file.systemd
in the container. Its startup program is the container application process. The container exists for the main process. Once the main process exits, the container loses its meaning of existence and thus exits. So when you execute multiple commands and if they are blocking, you better write the previous commands in nohup and the last command in the blocking command. (never use the command such as CMD service nginx start
, the CMD only will execute as CMD [ "sh", "-c", "service nginx start"]
, when the sh is executed, the container will exit, the correct way is run it directly CMD ["nginx", "-g", "daemon off;"]
)This is a cheatsheet of docker.
Note: the docs will be updated from time to time.
...Docker is a practical tool for everyday use, and like Git
, you can learn it in just 30 minutes.