小编Who*_*AmI的帖子

错误:服务“ xxx”使用未定义的网络“ xxx”

一直说我这个网络是不确定的。错误:服务“前端网络”使用未定义的网络“前端网络”但是,我看到存在带有docker network ls的网络。我想念的是什么:(我需要您的帮助。我已经在Google上学到很多,但是找不到正确的解决方案。

version: "3.3"
    services:
      web:
        build: ./Docker
        container_name: apache
        ports:
        - "80:80"
        volumes:
        - /home/denis/public-html:/usr/local/apache2/htdocs/
        restart: always
        networks:
        - frontend
        labels:
        - webstack
      mara:
        image: mariadb:latest
        container_name: mara
        ports:
        - "3306:3306"
        volumes:
        - ~/MariyaDb:/var/lib/mysql
        depends_on:
        - "web"
        restart: always
        networks:
        - frontend
        labels:
        - webstack
        environment:
        - MYSQL_ROOT_PASSWORD=example
      adminer:
        image: adminer
        container_name: adminer
        ports:
        - "8080:8080"
        depends_on:
        - "mara"
        restart: always
        networks:
        - frontend-network
        labels:
        - webstack
Run Code Online (Sandbox Code Playgroud)

linux docker docker-compose devops

8
推荐指数
2
解决办法
3184
查看次数

Docker-Compose:服务 xxx 依赖于未定义的服务 xxx

我有这个错误:

错误:服务 'db' 依赖于未定义的服务 'apache'。

为什么说 apache 是未定义的?我检查缩进。应该是对的。

version: '3.5'

services:
  apache:
    build: ./Docker
    image: apache:latest
    ports:
     - "80:80"
    restart: always
networks:
       default:
         name: frontend-network

services:
  db:
    image: mariadb:latest
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: example
    depends_on:
    - "apache"
  adminer:
    image: adminer
    restart: always
    ports:
    - "8080:8080"
    depends_on:
    - "db"
networks:
      default:
        name: frontend-network
Run Code Online (Sandbox Code Playgroud)

linux docker docker-compose devops

4
推荐指数
1
解决办法
1万
查看次数

尽管skipDefaultCheckout true J​​enkins仍然克隆存储库

尽管使用了skipDefaultCheckout true,它仍然克隆了git repo。我的目标只是寻找更改然后执行某些脚本。我已经没有主意了。我尝试了如何在脚本化管道中使用 SkipDefaultCheckout,但我想它不起作用?

pipeline {
  agent any
  options {
    skipDefaultCheckout true
  }
   environment {
       branch = 'test'
   }
  stages {
    stage('commit_stage') {
      steps {
        script {
          properties([pipelineTriggers([pollSCM('*/5 * * * *')])])
          git branch: "${branch}", credentialsId: 'test', url: 'https://gitlab.test.net/core/test.git'
          sh '''
          branch=${branch}
          ssh bamboo@app-test.synchr.net "cd /opt/${branch}-8*/ && ./startup.sh status"
             '''
                }
          //define scm connection for polling

      }
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

groovy jenkins devops jenkins-pipeline

1
推荐指数
1
解决办法
1万
查看次数