Easily build and run components with Dockerfile
Rainbond platformsupports building and running images directly throughDockerfile, the operation process is simple, and it is convenient for continuous iteration.
The operation process is divided into the following steps:
CreatedDockerfileprojects onGithub,Demo projects
Dockerfilecontent
ARG VERSION=1.15.0
FROM nginx:${VERSION}-alpine
COPY index.html /usr/share/nginx/html/
VOLUME /data
EXPOSE 80Select the project to build through the source code build function of theRainbond platform
Verify the mirror operation effect
Among them, the following points need to be paid to
- When Rainbond platformbuilds the source code, the language type is identified through the personalized files of different types of codes, so there must beDockerfilefiles in the specified directory of the project
- The build process is equivalent to executing
docker build -t image:tag .
in the specified directory of the project (default is / directory), so you need to pay attention to the choice of relative paths when using modules such asCOPY
andADD
inDockerfile - The daemon process of the mirror needs to be specified. If the daemon process is not specified, it will automatically exit and restart after the mirror startup command is completed, and the built components may be in an abnormal state.
advantages over normalDockerenvironment:
For users who need to continuously adjustDockerfile, the build process is simpler. By referring toto configure components to automatically build and deploy, you can useGithubandWebhookto implement code modification and complete image update operations.