手动制作国产soul网关 docker镜像
in Docker with 2 comment

手动制作国产soul网关 docker镜像

in Docker with 2 comment

1. 下载soul

下载国产soul网关jar包

soul-admin

2 docker镜像制作

FROM java:8
MAINTAINER zhouxinlei
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && echo "Asia/Shanghai" > /etc/timezone
VOLUME /tmp
EXPOSE 9095
ADD soul-admin.jar soul-admin.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/soul-admin.jar","--spring.datasource.url=${jdbcUrl}","--spring.datasource.username=${username}","--spring.datasource.password=${password}"]
docker build -t soul-admin:1.0 .

image.png

image.png

version: '3'
services:
  soul-admin:
    image: soul-admin:1.0
    container_name: soul-admin
    environment:
      - "jdbcUrl=你的数据库地址"
      - "username=你的数据库用户名"
      - "password=你的数据库密码"
    ports:
      - 9095:9095
    restart: always
docker-compose up -d

image.png

默认账号密码是:admin 123456

image.png

3. 总结

讲常规的项目应用转为docker镜像其实不太难,掌握基本的dockerfile指令,大部分简单的应用都可以转换

大家可以试试我上传的soul镜像吧~

docker pull registry.cn-hangzhou.aliyuncs.com/zhouxinlei/soul-admin:latest