2017-07-27 216 views
1

我試圖設置泊塢窗&譜寫運行集成測試搬運工,撰寫OCI運行時錯誤的可執行文件未找到(在連接容器)

我有以下泊塢窗,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: {} 

網絡容器本身的工作原理相當優良

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

但是當我運行個測試容器,我得到的錯誤

$ 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" 

這裏是我的Dockerfile.web

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

/應用/網絡動態鏈接寫在Golang 1.6

守護程序和一些版本信息

$ 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 
+0

這是什麼輸出? '泊塢窗,構成-p Wh是運行網絡LS -l' – Robert

+0

@Robert, '$碼頭工人,組成-p Wh是運行網絡LS -l' '開始wh_maindb_1 ... done' '總21272' '-rwxrwxr-X 1根根2288256年07月24 21:19 scheduler' '-rwxrwxr-X 1根根5855104年07月24 21:19 sender' '-rwxrwxr-X 1根根13631752年07月24 21: 19 web' –

+0

對不起。我應該要求測試:'docker-compose -p wh運行測試ls -l'。並請顯示其Dockerfile – Robert

回答

0

這可能與一些docker-compose bug有關。

嘗試清潔容器

docker-compose down 

或者這(你將失去你的集裝箱式數據):

docker rm -f $(docker ps -a -q)