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 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?