Docker | docker使用java容器启动jar包

docker pull openjdk:8u265
mkdir -p /usr/local/docker/jar/data/administration_schedule/backup
docker run -d  --name=message-center --hostname=localhost  --network=host --restart=always -v /usr/local/docker/jar:/usr/local/jar openjdk:8u265  java -jar /usr/local/jar/message-center.jar

#此处若不加 --hostname 参数,会有“ERROR net.sf.ehcache.Cache - Unable to set localhost. This prevents creation of a GUID. Cause was: MessTaskV3: MessTaskV3: Name or service not known”报错

你可能感兴趣的:(Docker)