Scene
A 1-hour Docker container is available for external service, and containers are destroyed when the time is up.
The files in a directory are packaged in tar before being destroyed and saved to the specified directory on the host machine.
Problem
1, what is the plan for you to take the timing?
2, problem two how to do technical realization?
首先不管对错,感谢每一位回答者
Reply content:
Scene
A 1-hour Docker container is available for external service, and containers are destroyed when the time is up.
The files in a directory are packaged in tar before being destroyed and saved to the specified directory on the host machine.
Problem
1, what is the plan for you to take the timing?
2, problem two how to do technical realization?
首先不管对错,感谢每一位回答者
Question 1:
When started, for example: docker-compose run --rm app
Then run a scheduled task on the host to stop:* 1 1 1 1 docker-compose stop app
Question 2:
will be docker-compose stop app
written into the script
Before this, write the packaged command, if you first use a local directory as a volume of the container, so that the packaged files are on the host