Create a 'docker_start.sh' file and add executable permissions 'chmod +x docker_start.sh'.
Edit the docker_start.sh and write the following:
#!/bin/bash
projectName=demo
projectPath=/data/project/test
mirror=xiejindou/java:17
docker stop $projectName && docker rm $projectName
docker run --name $projectName \
-p 80:8000 \
-w /mnt \
-v ${projectPath}/${projetName}.jar:/mnt/app.jar \
-v /etc/localtime:/etc/localtime:ro \
-e ENV=--spring.profiles.active=dev \
-d ${mirror}
Content type
Image
Digest
sha256:91f455ad1…
Size
80.4 MB
Last updated
about 3 years ago
docker pull xiejindou/java:8