Running on Docker
Categories:
Running on Docker
This guide provides instructions for building and running simulations using Docker for the SCOP Framework.
Prerequisites
Before you begin, make sure you have the following installed on your system:
- Docker (tested on version 4.35.0)
- An active internet connection to pull base images and dependencies.
Required Files
Ensure that the following file is present in your working directory:
Dockerfile
(located in the root directory of your project)
The Dockerfile
contains the instructions necessary to build the Docker image that will run your simulation.
Build the Docker Image
To build the Docker image, run the following command in your terminal:
docker build --no-cache -t model-name .
--no-cache
: Ensures that the build process does not use any cached layers.- Replace
model-name
with the desired name for your Docker image.
This process may take some time depending on the complexity of your Dockerfile
and the dependencies required.
Run the Docker Image as a Detached Container
After building the image, run it as a detached container using:
docker run -d --name model-name-container model-name
-d
: Runs the container in detached mode (in the background).--name model-name-container
: Sets the name of the running container tomodel-name-container
(you can change this to any name you prefer).model-name
: Refers to the Docker image you built earlier.
Verify the Running Container
To verify that your container is running, use:
docker ps
- This command lists all active containers. Look for
model-name-container
in the output to confirm that your container is running.
View Container Logs
To view the logs generated by your running container, use:
docker logs model-name-container
- This command helps you monitor the output of your simulation and is useful for debugging any issues.
Stop the Running Container
When you need to stop the container, use:
docker stop model-name-container
- This will gracefully stop the container named
model-name-container
.
Additional Tips
-
Restart a Stopped Container: If you want to restart a stopped container, use:
docker start model-name-container
-
Remove a Container: To remove a container after it has stopped, use:
docker rm model-name-container
-
Remove an Image: If you need to remove the Docker image, use:
docker rmi model-name
By following these steps, you will be able to build, run, monitor, and manage Docker containers for the SCOP Framework simulations. Adjust the commands and options as needed to suit your specific project requirements.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.