- Package the Spring Boot project into a JAR package
2. Create a folder on the server to store the JAR package
-
The packaged JAR package is sent to the server using Xshell
Note: To create a new session on Xshell, enter the command rz-y. Select the file to upload
-
Create a dockerFile file under the folder we created in step 2.
Note: The contents of a dockerfile file vary depending on your situation
- View the contents contained in the hellowDocker folder
6. Create an image
7. Check whether the image is successfully created
8. Start the container
Note: the -d parameter is used to run the container in the background. -p is used to map port 8087 in the server to port 8087 in the container (port 8087 is configured in the project)
9. Check whether the test is successful in the browser (server IP: port number/method path in the project)
This has been done successfully.