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 网络科学导论,网络控制
  • ¥100 安卓tv程序连接SQLSERVER2008问题
  • ¥15 利用Sentinel-2和Landsat8做一个水库的长时序NDVI的对比,为什么Snetinel-2计算的结果最小值特别小,而Lansat8就很平均
  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同