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 求一整套c语言的modbus rtu命令功能码
  • ¥15 对语音信号进行变调时,间接改变时序从而实现语音变速,进而将变调与变速同时实现、参数合成法换为波形合成法
  • ¥30 德飞莱51单片机实现C4炸弹
  • ¥50 CrossLink-LIF-MD6000 型 FPGA 的 CMOS 转 MIPI D-PHY IP 核功能使用异常
  • ¥15 proteus控制16x16LED点阵显示屏的设计
  • ¥30 求会做山景bp1048b2程序的。做直播声卡用
  • ¥15 求数学建模论文问题指导
  • ¥15 51单片机与数码管实现电子琴
  • ¥15 h3.6m 人类行为预测论文复现
  • ¥50 wordpress项目注册报失败刷新后其实是成功状态,请求排查原因