duanmao1919 2017-07-27 22:10
浏览 172
已采纳

找不到docker-compose oci运行时错误可执行文件(在链接的容器中)

I'm trying to setup docker & compose for running integration tests

I have the following docker-compose.yml

version: '3'
services:
    tests:
        build:
            context: .
            dockerfile: Dockerfile.tests
        links:
            - web
            - maindb
    web:
        build:
            context: .
            dockerfile: Dockerfile.web
        ports:
            - "8080:8080"
        volumes:
            - .:/code
            - logvolume01:/var/log
        links:
            - maindb
    maindb:
        image: postgres
        environment:
            POSTGRES_PASSWORD: example

volumes:
    logvolume01: {}

web container itself works pretty fine

$ docker-compose  -p wh  run web
Starting wh_maindb_1 ... done
2017/07/27 22:05:34 [I] http server Running on http://:8080

But when I run tests container, I get the error

$ docker-compose  -p wh  run tests
Starting wh_maindb_1 ... done
Starting 6faff07f7671_6faff07f7671_wh_web_1 ... 
Starting 6faff07f7671_6faff07f7671_wh_web_1 ... error

ERROR: for 6faff07f7671_6faff07f7671_wh_web_1  Cannot start service web: oci runtime error: container_linux.go:262: starting container process caused "exec: \"web\": executable file not found in $PATH"

Here is my Dockerfile.web

$ cat Dockerfile.web 
FROM ubuntu:xenial
WORKDIR /app
ADD bin/* /app/
CMD ["/app/web"]

/app/web is dynamically linked daemon written in Golang 1.6

And some version info

$ docker version 
Client:
 Version:      17.06.0-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:23:31 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.06.0-ce
 API version:  1.30 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:19:04 2017
 OS/Arch:      linux/amd64
 Experimental: false

$ docker-compose version
docker-compose version 1.14.0, build c7bdf9e
docker-py version: 2.4.2
CPython version: 2.7.12
OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016
  • 写回答

1条回答 默认 最新

  • dongshou2017 2017-07-28 18:15
    关注

    This is maybe related to some docker-compose bug.

    Try cleaning containers

    docker-compose down
    

    Alternatively this (you will lose your container data):

    docker rm -f $(docker ps -a -q)
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划