-
Fork the Repository
Fork this repository to your GitHub account to create your own working copy.
-
Launch a Codespace
Go to your forked repository on GitHub. Click on Code > Codespaces > Create codespace on main. Wait for the Codespace to initialize. The setup may take a few minutes.
-
Verify Docker Setup
Once the Codespace is ready, open the terminal and run the following commands to verify that Docker and Docker Compose are available:
foo@bar:~$docker --version foo@bar:~$docker-compose --version foo@bar:~$docker run hello-world -
Run Your First Docker Container
To test the Docker setup, you can run a sample NGINX container:
foo@bar:~$docker run -d -p 8080:80 nginxOpen the Ports tab in Codespaces to view and access the running NGINX container on port 8080.
-
Stopping and Cleaning Up
When you’re done, stop any running containers with:
foo@bar:~$docker stop <container_id>
-
Install necessary tools and libraries
An installation script is available in the repository.
foo@bar:~$chmod +x ./setup_env.sh chmod +x ./setup_env.sh
- The script prepares a demo application, PetClinic (GitHub Repository), written in the Spring Boot framework.
As part of the setup, the application is built and a JAR file is generated.
You need to containerize the application using following method (or find a different one):
-
Simple Solution
- Use the available JAR artifact in the environment to containerize the application.
-
Deployment and running the application
- Run the containerized application and expose it on port 8080.
- Check that the application is accessible in your browser.
Leaving it running can lead to unnecessary charges, so make it a habit to shut down any unused Codespaces.