测试

一、课程方式安装Docker

# 1、yum 包更新到最新 
yum update
# 2、安装需要的软件包, yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的 
yum install -y yum-utils device-mapper-persistent-data lvm2
# 3、 设置yum源
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# 4、 安装docker,出现输入的界面都按 y 
yum install -y docker-ce
# 5、 查看docker版本,验证是否验证成功
docker -v

二、其他安装方式(推荐)

教程链接:https://www.jianshu.com/p/1e5c86accacb

centos 安装特定版本

docker-compose.yml

version: "3.7"

services:

  fy-account:
    image: "togger/8-jre-alpine"
    restart: always
    environment:
      TZ: "${TIME_ZONE:-Asia/Shanghai}"
    expose:
      - "19200"
    volumes:
      - "${FY_ACCOUNT_PATH:-./fy-account}:/ws:ro"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.account-api.rule=Host(`account-api`)"
      - "traefik.http.routers.account-api.entrypoints=web"
      - "traefik.http.routers.account-login.rule=Host(`api.account-dev.faabc.cn`) && (PathPrefix(`/login/`) || PathPrefix(`/aliyun/`) || PathPrefix(`/wxpay/`))"
      - "traefik.http.routers.account-login.entrypoints=web-secure"
      - "traefik.http.routers.account-login.tls=true"
      - "traefik.http.routers.account-login.middlewares=account-header"
      - "traefik.http.routers.account-guest.rule=Host(`api.account-dev.faabc.cn`) && PathPrefix(`/guest/`)"
      - "traefik.http.routers.account-guest.entrypoints=web-secure"
      - "traefik.http.routers.account-guest.tls=true"
      - "traefik.http.routers.account-guest.middlewares=account-header,account-guest"
      - "traefik.http.middlewares.account-guest.forwardauth.address=http://account-api/token/auth"
      - "traefik.http.middlewares.account-guest.forwardauth.trustForwardHeader=true"
      - "traefik.http.middlewares.account-guest.forwardauth.authResponseHeaders=X-Auth-App-ID,X-Auth-Channel-ID,X-Auth-Login-ID,X-Auth-User-ID"
      - "traefik.http.routers.account-user.rule=Host(`api.account-dev.faabc.cn`) && PathPrefix(`/user/`)"
      - "traefik.http.routers.account-user.entrypoints=web-secure"
      - "traefik.http.routers.account-user.tls=true"
      - "traefik.http.routers.account-user.middlewares=account-header,account-user"
      - "traefik.http.middlewares.account-user.forwardauth.address=http://account-api/token/auth?roles=1"
      - "traefik.http.middlewares.account-user.forwardauth.trustForwardHeader=true"
      - "traefik.http.middlewares.account-user.forwardauth.authResponseHeaders=X-Auth-App-ID,X-Auth-Channel-ID,X-Auth-Login-ID,X-Auth-User-ID"
      - "traefik.http.routers.account-admin.rule=Host(`api.account-dev.faabc.cn`) && PathPrefix(`/admin/`)"
      - "traefik.http.routers.account-admin.entrypoints=web-secure"
      - "traefik.http.routers.account-admin.tls=true"
      - "traefik.http.routers.account-admin.middlewares=account-header,account-admin"
      - "traefik.http.middlewares.account-admin.forwardauth.address=http://account-api/token/auth?roles=2"
      - "traefik.http.middlewares.account-admin.forwardauth.trustForwardHeader=true"
      - "traefik.http.middlewares.account-admin.forwardauth.authResponseHeaders=X-Auth-App-ID,X-Auth-Channel-ID,X-Auth-Login-ID,X-Auth-User-ID"
      - "traefik.http.routers.account-channel.rule=Host(`api.account-dev.faabc.cn`) && PathPrefix(`/channel/`)"
      - "traefik.http.routers.account-channel.entrypoints=web-secure"
      - "traefik.http.routers.account-channel.tls=true"
      - "traefik.http.routers.account-channel.middlewares=account-header,account-channel"
      - "traefik.http.middlewares.account-channel.forwardauth.address=http://account-api/token/auth?roles=4"
      - "traefik.http.middlewares.account-channel.forwardauth.trustForwardHeader=true"
      - "traefik.http.middlewares.account-channel.forwardauth.authResponseHeaders=X-Auth-App-ID,X-Auth-Channel-ID,X-Auth-Login-ID,X-Auth-User-ID"
      - "traefik.http.middlewares.account-header.headers.accesscontrolallowheaders=Authorization,Origin,Content-Type,Accept,DNT,Sec-Fetch-Dest,User-Agent,X-Auth-App-ID,X-Auth-Channel-ID"
      - "traefik.http.middlewares.account-header.headers.accesscontrolallowmethods=GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS"
      - "traefik.http.middlewares.account-header.headers.accesscontrolalloworigin=*"
      - "traefik.http.middlewares.account-header.headers.accesscontrolmaxage=86400"
      - "traefik.http.middlewares.account-header.headers.addvaryheader=true"

  fy-zqb:
    image: "togger/8-jre-alpine"
    restart: always
    environment:
      TZ: "${TIME_ZONE:-Asia/Shanghai}"
    expose:
      - "19201"
    volumes:
      - "${FY_ZQB_PATH:-./fy-zqb}:/ws:ro"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.fy-zqb-aliyun.rule=Host(`api.zqb-dev.faabc.cn`) && PathPrefix(`/aliyun/`)"
      - "traefik.http.routers.fy-zqb-aliyun.entrypoints=web-secure"
      - "traefik.http.routers.fy-zqb-aliyun.tls=true"
      - "traefik.http.routers.fy-zqb-user.rule=Host(`api.zqb-dev.faabc.cn`) && PathPrefix(`/user/`)"
      - "traefik.http.routers.fy-zqb-user.entrypoints=web-secure"
      - "traefik.http.routers.fy-zqb-user.tls=true"
      - "traefik.http.routers.fy-zqb-user.middlewares=fy-zqb-user"
      - "traefik.http.middlewares.fy-zqb-user.forwardauth.address=http://account-api/token/auth?roles=1"
      - "traefik.http.middlewares.fy-zqb-user.forwardauth.trustForwardHeader=true"
      - "traefik.http.middlewares.fy-zqb-user.forwardauth.authResponseHeaders=X-Auth-App-ID,X-Auth-Channel-ID,X-Auth-Login-ID,X-Auth-User-ID"
      - "traefik.http.routers.fy-zqb-admin.rule=Host(`api.zqb-dev.faabc.cn`) && PathPrefix(`/admin/`)"
      - "traefik.http.routers.fy-zqb-admin.entrypoints=web-secure"
      - "traefik.http.routers.fy-zqb-admin.tls=true"
      - "traefik.http.routers.fy-zqb-admin.middlewares=fy-zqb-admin"
      - "traefik.http.middlewares.fy-zqb-admin.forwardauth.address=http://account-api/token/auth?roles=2"
      - "traefik.http.middlewares.fy-zqb-admin.forwardauth.trustForwardHeader=true"
      - "traefik.http.middlewares.fy-zqb-admin.forwardauth.authResponseHeaders=X-Auth-App-ID,X-Auth-Channel-ID,X-Auth-Login-ID,X-Auth-User-ID"

  fy-bqb:
    image: "togger/8-jre-alpine"
    restart: always
    environment:
      TZ: "${TIME_ZONE:-Asia/Shanghai}"
    expose:
      - "19202"
    volumes:
      - "${FY_BQB_PATH:-./fy-bqb}:/ws:ro"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.fy-bqb-api.rule=Host(`bqb-api`) && PathPrefix(`/internal/`)"
      - "traefik.http.routers.fy-bqb-api.entrypoints=web"
      - "traefik.http.routers.fy-bqb-user.rule=Host(`api.bqb-dev.faabc.cn`) && PathPrefix(`/user/`)"
      - "traefik.http.routers.fy-bqb-user.entrypoints=web-secure"
      - "traefik.http.routers.fy-bqb-user.tls=true"
      - "traefik.http.routers.fy-bqb-user.middlewares=fy-bqb-user"
      - "traefik.http.middlewares.fy-bqb-user.forwardauth.address=http://account-api/token/auth?roles=1"
      - "traefik.http.middlewares.fy-bqb-user.forwardauth.trustForwardHeader=true"
      - "traefik.http.middlewares.fy-bqb-user.forwardauth.authResponseHeaders=X-Auth-App-ID,X-Auth-Channel-ID,X-Auth-Login-ID,X-Auth-User-ID"
      - "traefik.http.routers.fy-bqb-admin.rule=Host(`api.bqb-dev.faabc.cn`) && PathPrefix(`/admin/`)"
      - "traefik.http.routers.fy-bqb-admin.entrypoints=web-secure"
      - "traefik.http.routers.fy-bqb-admin.tls=true"
      - "traefik.http.routers.fy-bqb-admin.middlewares=fy-bqb-admin"
      - "traefik.http.middlewares.fy-bqb-admin.forwardauth.address=http://account-api/token/auth?roles=2"
      - "traefik.http.middlewares.fy-bqb-admin.forwardauth.trustForwardHeader=true"
      - "traefik.http.middlewares.fy-bqb-admin.forwardauth.authResponseHeaders=X-Auth-App-ID,X-Auth-Channel-ID,X-Auth-Login-ID,X-Auth-User-ID"

  fy-notice:
    image: "togger/8-jre-alpine"
    restart: always
    environment:
      TZ: "${TIME_ZONE:-Asia/Shanghai}"
    expose:
      - "19100"
    volumes:
      - "${FY_NOTICE_PATH:-./fy-notice}:/ws:ro"

  fy-tts:
    image: "togger/8-jre-alpine"
    restart: always
    environment:
      TZ: "${TIME_ZONE:-Asia/Shanghai}"
    expose:
      - "19101"
    volumes:
      - "${FY_TTS_PATH:-./fy-tts}:/ws:ro"

  fy-cert:
    image: "togger/8-jre-alpine"
    restart: always
    environment:
      TZ: "${TIME_ZONE:-Asia/Shanghai}"
    expose:
      - "19102"
    volumes:
      - "${FY_CERT_PATH:-./fy-cert}:/ws:ro"

networks:
  default:
    external:
      name: local-net
Dockerfile
FROM openjdk:8-jre-alpine
VOLUME /tmp
WORKDIR /ws
ENV JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom -Dspring.jmx.enabled=false -Dspring.backgroundpreinitializer.ignore=true -XX:TieredStopAtLevel=1 -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -noverify"
ENTRYPOINT ["sh", "-c", "java ${JAVA_OPTS} -jar app.jar ${0} ${@}"]

你可能感兴趣的:(测试)