代码之家  ›  专栏  ›  技术社区  ›  John Manko

无法将工件加载到Docker上

  •  0
  • John Manko  · 技术社区  · 8 年前

    我首先创建一个地方来保存Artifactory的文件:

    # sudo mkdir /opt/artifactory/docker_volume

    人工操作系统-云数据库.yml:

    version: '3'
    
    services:
      artifactory:
        image: docker.bintray.io/jfrog/artifactory-oss:6.1.0
        ports:
          - 8081:8081
        volumes:
          - /opt/artifactory/docker_volume:/var/opt/jfrog/artifactory
          - /opt/artifactory/mysql-connector-java-8.0.11/mysql-connector-java-8.0.11.jar:/var/opt/jfrog/artifactory/tomcat/common/lib/mysql-connector-java-8.0.11.jar
        environment:
          - DB_TYPE=mysql
          - DB_USER=artifactory
          - DB_HOST=mysql
          - DB_PASSWORD=xxx
          - DB_URL=jdbc:mysql://my_sql:3306/artdb?characterEncoding=UTF-8&elideSetAutoCommits=true
        restart: always
        ulimits:
          nproc: 65535
          nofile:
            soft: 32000
            hard: 40000
    

    启动堆栈:

    # docker stack deploy -c artifactory-oss-mysql.yml artifactory

    docker_volume 主人变了,一切都不整洁了。唯一的例外是mysql连接器( /var/opt/jfrog/artifactory/tomcat/common/lib/mysql-connector-java-8.0.11.jar

    # ls -al
    drwxr-xr-x  5 root root    4096 Jul 17 17:47 .
    drwxr-xr-x 16 root root    4096 Jul 17 15:40 ..
    drwxr-xr-x  8 1030 1030    4096 Jul 17 17:47 docker_volume
    

    每个子目录都是空的(除了tomcat中的连接器):

    /opt/artifactory/docker_volume # ls -al
    total 32
    drwxr-xr-x 8 1030 1030 4096 Jul 17 17:47 .
    drwxr-xr-x 5 root root 4096 Jul 17 17:47 ..
    drwxr-xr-x 2 1030 1030 4096 Jul 17 17:47 access
    drwxr-xr-x 2 1030 1030 4096 Jul 17 17:47 backup
    drwxr-xr-x 2 1030 1030 4096 Jul 17 17:47 data
    drwxr-xr-x 2 1030 1030 4096 Jul 17 17:47 etc
    drwxr-xr-x 2 1030 1030 4096 Jul 17 17:47 logs
    drwxr-xr-x 3 1030 1030 4096 Jul 17 17:47 tomcat
    

    # docker service logs zh3fiophtdvu

        Preparing to run Artifactory in Docker
    =====================================
    2018-07-17 21:13:06   [44 entrypoint-artifactory.sh] Dockerfile for this image can found inside the container.
    2018-07-17 21:13:06   [45 entrypoint-artifactory.sh] To view the Dockerfile: 'cat /docker/artifactory-oss/Dockerfile.artifactory'.
    2018-07-17 21:13:06   [50 entrypoint-artifactory.sh] Checking open files and processes limits
    2018-07-17 21:13:06   [53 entrypoint-artifactory.sh] Current max open files is 1048576
    2018-07-17 21:13:06   [65 entrypoint-artifactory.sh] Current max open processes is unlimited
    2018-07-17 21:13:06   [75 entrypoint-artifactory.sh] Checking if /var/opt/jfrog/artifactory is mounted
    2018-07-17 21:13:06   [80 entrypoint-artifactory.sh] /var/opt/jfrog/artifactory is mounted
    2018-07-17 21:13:06   [86 entrypoint-artifactory.sh] Setting up data directories if missing
    2018-07-17 21:13:06   [97 entrypoint-artifactory.sh] Create artifactory user if missing
    2018-07-17 21:13:06  [100 entrypoint-artifactory.sh] User does not exist. Creating it...
    2018-07-17 21:13:06  [137 entrypoint-artifactory.sh] Checking permissions on /opt/jfrog/artifactory
    2018-07-17 21:13:06  [143 entrypoint-artifactory.sh] /opt/jfrog/artifactory is owned by root:root. Setting to artifactory:artifactory.
    2018-07-17 21:13:06  [150 entrypoint-artifactory.sh] Checking permissions on /var/opt/jfrog/artifactory
    2018-07-17 21:13:06  [159 entrypoint-artifactory.sh] /var/opt/jfrog/artifactory is already owned by artifactory:artifactory.
    2018-07-17 21:13:06  [282 entrypoint-artifactory.sh] Checking DB_TYPE
    2018-07-17 21:13:06  [285 entrypoint-artifactory.sh] DB_TYPE is set to mysql
    2018-07-17 21:13:06   [34 entrypoint-artifactory.sh] ERROR: No mysql connector found
    
    1 回复  |  直到 8 年前
        1
  •  0
  •   Nicola Ben    8 年前

    为了更好地理解和解决您的问题,我将尝试以下几点:

    • 去除 ulimits.nofile 部分

    • chown -R 1030:1030 对于您所需的卷

    这似乎是个许可问题。

    推荐文章