Contoso is a company that sells products for various outdoor activities. A marketing department of Contoso would like to launch a micro social media website to promote their products for existing and potential customers.
They now have both Java-based backend app and .NET-based frontend app. They want to make them containerized so that they can be deployed any platform.
Now, as a DevOps engineer, you should containerize both apps.
Refer to the README doc for preparation.
- Check GitHub Copilot Agent Mode
- Prepare Custom Instructions
- Containerize Java Application
- Containerize .NET Application
- Orchestrate Containers
-
Click the GitHub Copilot icon on the top of GitHub Codespace or VS Code and open GitHub Copilot window.
-
If you're asked to login or sign up, do it. It's free of charge.
-
Make sure you're using GitHub Copilot Agent Mode.
-
Select model to either
GPT-4.1orClaude Sonnet 4. -
Make sure that you've configured MCP Servers.
-
Set the environment variable of
$REPOSITORY_ROOT.# bash/zsh REPOSITORY_ROOT=$(git rev-parse --show-toplevel)
# PowerShell $REPOSITORY_ROOT = git rev-parse --show-toplevel
-
Copy custom instructions.
# bash/zsh cp -r $REPOSITORY_ROOT/docs/custom-instructions/containerization/. \ $REPOSITORY_ROOT/.github/
# PowerShell Copy-Item -Path $REPOSITORY_ROOT/docs/custom-instructions/containerization/* ` -Destination $REPOSITORY_ROOT/.github/ -Recurse -Force
-
Make sure that you're using GitHub Copilot Agent Mode with the model of
Claude Sonnet 4orGPT-4.1. -
Use prompt like below to build a container image for the Java app.
I'd like to build a container image of a Java app. Follow the instructions below. - The Java app is located at `complete/java`. - Your working directory is the repository root. - Identify all the steps first, which you're going to do. - Create a Dockerfile, `Dockerfile.java`. - Use Microsoft OpenJDK 21. - Use multi-stage build approach. - Extract JRE from JDK. - Use the target port number of `8080` for the container image. -
Click the
[keep]button of GitHub Copilot to take the changes. -
Once
Dockerfile.javais created, build the container image with the following prompt.Use `Dockerfile.java` and build a container image. - Use `contoso-backend` as the container image name. - Use `latest` as the container image tag. - Verify if the container image is built properly. - If the build fails, analyze the issues and fix them. -
Click the
[keep]button of GitHub Copilot to take the changes. -
Once the build succeeds, run the container image with the following prompt.
Use the container image just built, run a container and verify if the app is running properly. - Use the host port of `5050`.
-
Make sure that you're using GitHub Copilot Agent Mode with the model of
Claude Sonnet 4orGPT-4.1. -
Use prompt like below to build a container image for the .NET app.
I'd like to build a container image of a .NET app. Follow the instructions below. - The .NET app is located at `complete/dotnet`. - Your working directory is the repository root. - Identify all the steps first, which you're going to do. - Create a Dockerfile, `Dockerfile.dotnet`. - Use .NET 9. - Use multi-stage build approach. - Use the target port number of `8080` for the container image. -
Click the
[keep]button of GitHub Copilot to take the changes. -
Once
Dockerfile.dotnetis created, build the container image with the following prompt.Use `Dockerfile.dotnet` and build a container image. - Use `contoso-frontend` as the container image name. - Use `latest` as the container image tag. - Verify if the container image is built properly. - If the build fails, analyze the issues and fix them. -
Click the
[keep]button of GitHub Copilot to take the changes. -
Once the build succeeds, run the container image with the following prompt.
Use the container image just built, run a container and verify if the app is running properly. - Use the host port of `3030`. -
Make sure that both frontend and backend apps are NOT communicating with each other because they don't know each other yet. Run the prompt like below.
Regardless or not, remove both containers currently running.
-
Make sure that you're using GitHub Copilot Agent Mode with the model of
Claude Sonnet 4orGPT-4.1. -
Use prompt like below to build a Docker Compose file.
I'd like to create a Docker Compose file. Follow the instructions below. - Your working directory is the repository root. - Use `Dockerfile.java` as a backend app. - Use `Dockerfile.dotnet` as a frontend app. - Create `compose.yaml` as the Docker Compose file. - Use `contoso` as the network name. - Use `contoso-backend` as the container name of the Java app. Its target port is 8080, and host port is 5050. - Use `contoso-frontend` as the container name of the .NET app. Its target port is 8080, and host port is 3030. -
Once the
compose.yamlfile is created, run it and verify if both apps are running properly.Now, run the Docker compose file and verify if the apps are running properly. -
Open a web browser and navigate to
http://localhost:3030, and verify if the apps are up and running properly.
Congratulations! 🎉 You've completed all the workshop sessions successfully!

