TBD Flashcards
Miscellaneous Cards
Given the following requirements for a Docker container setup, construct the appropriate Docker command to run a container:
Use the Docker image named “registryName/api-service”.
Name the container “api-service-box”.
Ensure that the container is removed once it stops.
Map the host port 8080 to the container’s port 8080.
Connect the container to a Docker network named “spring-boot-demo_db”.
Pass an additional argument to the container, specifying the Spring Boot data source URL for a PostgreSQL database. The URL should connect to a host named “mydb”, on port 5432, and the database name should be “customer”.
Tip: Remember the structure of a Docker run command, and make sure you position the Docker image and additional argument correctly.
docker run –name api-service-box –rm -p 8080:8080 –network spring-boot-demo_db registryName/api-service –spring.datasource.url=jdbc:postgresql://mydb:5432/customer