Failed to execute script docker compose windows

I use mac 10.11.6 El capitan and i installed docker toolbox and i am trying to use docker compose build option but i am throwing some errors as follows, kj$ docker-compose -f docker-compose-dev.yml

I use mac 10.11.6 El capitan and i installed docker toolbox and i am trying to use docker compose build option but i am throwing some errors as follows,

kj$ docker-compose -f docker-compose-dev.yml build
Traceback (most recent call last):
  File "docker-compose", line 6, in <module>
  File "compose/cli/main.py", line 71, in main
  File "compose/cli/main.py", line 124, in perform_command
  File "compose/cli/command.py", line 41, in project_from_options
  File "compose/cli/command.py", line 113, in get_project
  File "compose/config/config.py", line 380, in load
  File "compose/config/config.py", line 380, in <listcomp>
  File "compose/config/config.py", line 513, in process_config_file
  File "compose/config/config.py", line 221, in get_service_dicts
  File "distutils/version.py", line 46, in __eq__
  File "distutils/version.py", line 337, in _cmp
TypeError: '<' not supported between instances of 'str' and 'int'
[83046] Failed to execute script docker-compose

The content of yml file

version: '3.3'

services:

  users:
    build:
      context: ./
      dockerfile: Dockerfile-dev
    volumes:
      - './:/usr/src/app'
    ports:
      - 5001:5000
    environment:
      - FLASK_APP=project/__init__.py
      - FLASK_ENV=development

I am not sure what causes this problem, Please give your suggestions, Thanks

Description of the issue

Fresh install of docker, seem to be getting a rather strange error when trying to
build with docker-compose build and the most simple of build files.

Context information (for bug reports)

Output of docker-compose version

docker-compose version 1.27.4, build 40524192
docker-py version: 4.3.1
CPython version: 3.7.7
OpenSSL version: OpenSSL 1.1.1g  21 Apr 2020

Output of docker version

Client: Docker Engine - Community
 Cloud integration: 1.0.2
 Version:           19.03.13
 API version:       1.40
 Go version:        go1.13.15
 Git commit:        4484c46d9d
 Built:             Wed Sep 16 16:58:31 2020
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.13
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       4484c46d9d
  Built:            Wed Sep 16 17:07:04 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.3.7
  GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Output of docker-compose config
(Make sure to add the relevant -f and other flags)

services:
  webapp:
    build:
      context: /Users/aleccooper/Github/Strava-Rankings/Strava-Ranking/StravaRanking/ranking_app
version: '3.8'

Steps to reproduce the issue

  1. create following simple docker-compose.yml file
version: "3.8"

services:
  webapp:
    build: ./ranking_app
  1. run docker-compose build

Observed result

Build fails with the below error

Expected result

Expect build to pass

Stacktrace / full error message

Traceback (most recent call last):
File «compose/cli/main.py», line 67, in main
File «compose/cli/main.py», line 126, in perform_command
File «compose/cli/main.py», line 302, in build
File «compose/project.py», line 468, in build
File «compose/project.py», line 450, in build_service
File «compose/service.py», line 1147, in build
compose.service.BuildError: (<Service: web>, {‘message’: ‘Cannot locate specified Dockerfile: Dockerfile’})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File «docker-compose», line 3, in
File «compose/cli/main.py», line 78, in main
TypeError: can only concatenate str (not «dict») to str
[2640] Failed to execute script docker-compose

Additional information

OS version / distribution, docker-compose install method, etc.

macOS Catalina 10.15.7

I’m just at a loss with all these issues with Docker I’m having. This was working just fine and I haven’t touched it for a couple days SINCE it was working fine. So nothing could have been changed to make the app not load. I try to docker-compose build because I needed to fix my entrypoint.sh file that has the .pid file remover line. Here’s the output when I try to run docker-compose build:

Kyle_@LAPTOP-KSPCT1K1 MINGW64 /c/users/kyle_/desktop/canabnb (master)
$ docker-compose build
db uses an image, skipping
Building web
[6204] Failed to execute script docker-compose
Traceback (most recent call last):
  File "site-packagesdockerutilsbuild.py", line 96, in create_archive
OSError: [Errno 22] Invalid argument: '\\?\C:\users\kyle_\desktop\canabnb\node_modules\.bin\acorn'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker-compose", line 6, in <module>
  File "composeclimain.py", line 72, in main
  File "composeclimain.py", line 128, in perform_command
  File "composeclimain.py", line 304, in build
  File "composeproject.py", line 403, in build
  File "composeproject.py", line 385, in build_service
  File "composeservice.py", line 1106, in build
  File "site-packagesdockerapibuild.py", line 160, in build
  File "site-packagesdockerutilsbuild.py", line 31, in tar
  File "site-packagesdockerutilsbuild.py", line 100, in create_archive
OSError: Can not read file in context: \?C:userskyle_desktopcanabnbnode_modules.binacorn

This doesn’t make any sense to me and I have no idea where to even look to fix this error. It does say OSError at first so I’m wondering if it’s just some issue with Windows. Please help me on this, but keep in mind I’m still EXTREMELY NEW and only know basic coding HTML, CSS and some Rails as that’s what my bootcamp taught me. I in no way have any experience with Docker or any other type of development environment stuff. I realize I need to look into this and learn, but I’m just trying to build a simple web portfolio first. Any help is greatly appreciated!

I also have a repo set up for this app https://github.com/Kyle-Williamson-Dev/CanaBnb

JamalWeb

ОС у меня Ubuntu 18.04
Docker и docker-compose устанавливал по документаций https://docs.docker.com
При сборке любого образа выдается такое сообщение

sudo docker-compose up -d
[sudo] пароль для jamal:
Creating network «dockers_default» with the default driver
Pulling nginx (nginx:)…
Traceback (most recent call last):
File «bin/docker-compose», line 6, in
File «compose/cli/main.py», line 72, in main
File «compose/cli/main.py», line 128, in perform_command
File «compose/cli/main.py», line 1107, in up
File «compose/cli/main.py», line 1103, in up
File «compose/project.py», line 542, in up
File «compose/service.py», line 360, in ensure_image_exists
File «compose/service.py», line 1248, in pull
File «compose/progress_stream.py», line 102, in get_digest_from_pull
File «compose/service.py», line 1213, in _do_pull
File «site-packages/docker/api/image.py», line 396, in pull
File «site-packages/docker/auth.py», line 48, in get_config_header
File «site-packages/docker/auth.py», line 324, in resolve_authconfig
File «site-packages/docker/auth.py», line 235, in resolve_authconfig
File «site-packages/docker/auth.py», line 262, in _resolve_authconfig_credstore
File «site-packages/docker/auth.py», line 287, in _get_store_instance
File «site-packages/docker/credentials/store.py», line 25, in __init__
docker.credentials.errors.InitializationError: docker-credential-secretservice not installed or not available in PATH
[16794] Failed to execute script docker-compose

В чем может быть проблема ?


  • Вопрос задан

    более трёх лет назад

  • 1229 просмотров

Проблема не в докере, а в том, что в убунте сломаны пакеты docker-compose и docker-credential-secretservice
Решается через установку docker-compose при помощи pip install (плохой вариант) или — лучше — скачиванием с оф.сайта и копированием бинарного файла в /usr/local/bin

Еще можно использовать docker-compose в виде докер контейнера

Пригласить эксперта


  • Показать ещё
    Загружается…

04 февр. 2023, в 15:46

200 руб./за проект

04 февр. 2023, в 15:45

200000 руб./за проект

04 февр. 2023, в 15:02

10000 руб./за проект

Минуточку внимания

  • Remove From My Forums
  • Question

  • Hi all,

    I try to use Visual Studio 2017 to build the docker container, and never be able to get it work, I also get the following errors:

    ———————————————————————————————————————

    Severity Code
    Description Project
    File Line
    Suppression State
    Error MSB4018
    The «CleanWorkspace» task failed unexpectedly.
    Microsoft.DotNet.Docker.CommandLineClientException: Traceback (most recent call last):
      File «docker-compose», line 3, in <module>
      File «composeclimain.py», line 68, in main
      File «composeclimain.py», line 118, in perform_command
      File «composeclimain.py», line 525, in kill
      File «composeproject.py», line 278, in kill
      File «composeproject.py», line 498, in containers
      File «composeproject.py», line 489, in _labeled_containers
      File «site-packagesdockerapicontainer.py», line 189, in containers
      File «site-packagesdockerutilsdecorators.py», line 47, in inner
      File «site-packagesdockerapiclient.py», line 183, in _get
      File «site-packagesrequestssessions.py», line 488, in get
      File «site-packagesrequestssessions.py», line 475, in request
      File «site-packagesrequestssessions.py», line 596, in send
      File «site-packagesrequestsadapters.py», line 423, in send
      File «site-packagesrequestspackagesurllib3connectionpool.py», line 595, in urlopen
      File «site-packagesrequestspackagesurllib3connectionpool.py», line 363, in _make_request
      File «httplib.py», line 1042, in request
      File «httplib.py», line 1082, in _send_request
      File «httplib.py», line 1038, in endheaders
      File «httplib.py», line 882, in _send_output
      File «httplib.py», line 844, in send
      File «site-packagesdockertransportnpipeconn.py», line 31, in connect
      File «site-packagesdockertransportnpipesocket.py», line 22, in wrapped
      File «site-packagesdockertransportnpipesocket.py», line 50, in connect
    pywintypes.error: (2, ‘WaitNamedPipe’, ‘The system cannot find the file specified.’)
    Failed to execute script docker-compose.

    For more troubleshooting information, go to http://aka.ms/DockerToolsTroubleshooting —> Microsoft.DotNet.Docker.CommandLineClientException: Traceback (most recent call last):
      File «docker-compose», line 3, in <module>
      File «composeclimain.py», line 68, in main
      File «composeclimain.py», line 118, in perform_command
      File «composeclimain.py», line 525, in kill
      File «composeproject.py», line 278, in kill
      File «composeproject.py», line 498, in containers
      File «composeproject.py», line 489, in _labeled_containers
      File «site-packagesdockerapicontainer.py», line 189, in containers
      File «site-packagesdockerutilsdecorators.py», line 47, in inner
      File «site-packagesdockerapiclient.py», line 183, in _get
      File «site-packagesrequestssessions.py», line 488, in get
      File «site-packagesrequestssessions.py», line 475, in request
      File «site-packagesrequestssessions.py», line 596, in send
      File «site-packagesrequestsadapters.py», line 423, in send
      File «site-packagesrequestspackagesurllib3connectionpool.py», line 595, in urlopen
      File «site-packagesrequestspackagesurllib3connectionpool.py», line 363, in _make_request
      File «httplib.py», line 1042, in request
      File «httplib.py», line 1082, in _send_request
      File «httplib.py», line 1038, in endheaders
      File «httplib.py», line 882, in _send_output
      File «httplib.py», line 844, in send
      File «site-packagesdockertransportnpipeconn.py», line 31, in connect
      File «site-packagesdockertransportnpipesocket.py», line 22, in wrapped
      File «site-packagesdockertransportnpipesocket.py», line 50, in connect
    pywintypes.error: (2, ‘WaitNamedPipe’, ‘The system cannot find the file specified.’)
    Failed to execute script docker-compose
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.DotNet.Docker.DockerComposeClient.<ExecuteAsync>d__18.MoveNext()
       — End of inner exception stack trace —
       at Microsoft.DotNet.Docker.DockerComposeClient.<ExecuteAsync>d__18.MoveNext()
    — End of stack trace from previous location where exception was thrown —
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.DotNet.Docker.DockerComposeClient.<DownAsync>d__12.MoveNext()
    — End of stack trace from previous location where exception was thrown —
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.DotNet.Docker.DockerWorkspace.<CleanWorkspaceAsync>d__16.MoveNext()
    — End of stack trace from previous location where exception was thrown —
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.DotNet.Docker.BuildTasks.DockerBaseTask.Execute()
       at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
       at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
    docker-compose E:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildMicrosoftVisualStudiov15.0DockerMicrosoft.VisualStudio.Docker.Compose.targets
    208

    ————————————————————————————————————————————-

    My OS is Windows 7, and I’ve installed the following dependencies:
    1. Docker toolbox.
    2. Oracle VM VirtualBox.

    Another info, if I run the docker-compose on the docker terminal, I get a different error:

    $ docker-compose up
    Building visserver
    Step 1/6 : FROM microsoft/aspnetcore:1.1
     —> 46ad9a10d576
    Step 2/6 : ARG source
     —> Using cache
     —> 072a83a3880a
    Step 3/6 : WORKDIR /app
     —> Using cache
     —> da4aad3911b9
    Step 4/6 : EXPOSE 80
     —> Using cache
     —> a86cdebe4f0e
    Step 5/6 : COPY ${source:-obj/Docker/publish} .
    ERROR: Service ‘visserver’ failed to build: COPY failed: stat /mnt/sda1/var/lib/
    docker/tmp/docker-builder462427818/obj/Docker/publish: no such file or directory

    This confirm my understanding that the docker-compose configuration is correct on my machine, the issues resides in its Visual Studio 2017 integration.

    Does anyone share the same experience with me?

    Thanks,
    MarcoZ

    • Edited by

      Friday, July 21, 2017 7:13 AM

This post was most recently updated on June 23rd, 2022.

3 min read.

Once again, I come to you with a surprisingly opaque problem and offer to share my bemusingly simple solution. That should be a dedicated series on my blog – although on second thought, perhaps lobbing 90% of my articles under one tag wouldn’t be helpful… 😁

Problem

When running docker-compose up the command would fail, and instead, output a disgustingly long set of what looks like a whole pile of pythons engaging in quantum entanglement, that would angrily hiss at you if bothered.

It’s not pretty. And it turns out, it’s (at least in this case) also not descriptive at all!

So the errors I got? See below:

Error while fetching server API version: (2, 'CreateFile', 'The system cannot find the file specified.')

The whole stack trace looks something like the below:

Traceback (most recent call last):
   File "dockerapiclient.py", line 214, in _retrieve_server_version
   File "dockerapidaemon.py", line 181, in version
   File "dockerutilsdecorators.py", line 46, in inner
   File "dockerapiclient.py", line 237, in _get
   File "requestssessions.py", line 543, in get
   File "requestssessions.py", line 530, in request
   File "requestssessions.py", line 643, in send
   File "requestsadapters.py", line 439, in send
   File "urllib3connectionpool.py", line 670, in urlopen
   File "urllib3connectionpool.py", line 392, in _make_request
   File "httpclient.py", line 1255, in request
   File "httpclient.py", line 1301, in _send_request
   File "httpclient.py", line 1250, in endheaders
   File "httpclient.py", line 1010, in _send_output
   File "httpclient.py", line 950, in send
   File "dockertransportnpipeconn.py", line 32, in connect
   File "dockertransportnpipesocket.py", line 23, in wrapped
   File "dockertransportnpipesocket.py", line 72, in connect
   File "dockertransportnpipesocket.py", line 52, in connect
 pywintypes.error: (2, 'CreateFile', 'The system cannot find the file specified.')
 During handling of the above exception, another exception occurred:
 Traceback (most recent call last):
   File "docker-compose", line 3, in 
   File "composeclimain.py", line 81, in main
   File "composeclimain.py", line 199, in perform_command
   File "composeclicommand.py", line 60, in project_from_options
   File "composeclicommand.py", line 152, in get_project
   File "composeclidocker_client.py", line 41, in get_client
   File "composeclidocker_client.py", line 170, in docker_client
   File "dockerapiclient.py", line 197, in init
   File "dockerapiclient.py", line 221, in _retrieve_server_version
 docker.errors.DockerException: Error while fetching server API version: (2, 'CreateFile', 'The system cannot find the file specified.')
 [6316] Failed to execute script docker-compose

Augh. The system cannot find the file specified? API version? What is going on…

Reason

The solution – at least for me – was simple. But before delving into that, let me describe my setup so that you know whether it is applicable for you or not!

I run Docker on Windows. It is configured to run on startup and just do its thing – but occasionally it suddenly needs to gulp down over 10Gb or RAM, then proceed to do nothing, and finally requires a restart.

The OS itself is fine, it seems to recover nicely. So this time, I just killed the process, waited for a few minutes, and manually ran docker-compose from PowerShell.

That’s when the error was thrown at me. 😳

Solution

I was executing the command from my non-elevated PowerShell window. But that didn’t match how I have configured it to run on startup – instead, I needed to run docker-compose from an elevated PowerShell console.

I also realized my Docker Desktop won’t show any of my containers when run non-elevated. I guess that’s kinda obvious, right?

For you, running your stuff elevated (with admin permissions / “as an admin”) or from another user profile, if that’s how it’s configured to run normally, might work.

Stupid? Hey, if it works… 😁

References

  • Admin rights are not required for Docker on Windows anymore. It still seems to occasionally break, though. This Q on SO has some details on it: https://stackoverflow.com/questions/58663920/can-i-run-docker-desktop-on-windows-without-admin-privileges#:~:text=If%20your%20admin%20account%20is,the%20changes%20to%20take%20effect.
  • Author
  • Recent Posts

mm

Antti Koskela is a proud digital native nomadic millennial full stack developer (is that enough funny buzzwords? That’s definitely enough funny buzzwords!), who works as Solutions Architect for Precio Fishbone, building delightful Digital Workplaces.

He’s been a developer from 2004 (starting with PHP and Java), and he’s been working on .NET projects, Azure, Office 365, SharePoint and a lot of other stuff. He’s also Microsoft MVP for Office Development.

This is his personal professional (e.g. professional, but definitely personal) blog.

mm

I use mac 10.11.6 El capitan and i installed docker toolbox and i am trying to use docker compose build option but i am throwing some errors as follows,

kj$ docker-compose -f docker-compose-dev.yml build
Traceback (most recent call last):
  File "docker-compose", line 6, in <module>
  File "compose/cli/main.py", line 71, in main
  File "compose/cli/main.py", line 124, in perform_command
  File "compose/cli/command.py", line 41, in project_from_options
  File "compose/cli/command.py", line 113, in get_project
  File "compose/config/config.py", line 380, in load
  File "compose/config/config.py", line 380, in <listcomp>
  File "compose/config/config.py", line 513, in process_config_file
  File "compose/config/config.py", line 221, in get_service_dicts
  File "distutils/version.py", line 46, in __eq__
  File "distutils/version.py", line 337, in _cmp
TypeError: '<' not supported between instances of 'str' and 'int'
[83046] Failed to execute script docker-compose

The content of yml file

version: '3.3'

services:

  users:
    build:
      context: ./
      dockerfile: Dockerfile-dev
    volumes:
      - './:/usr/src/app'
    ports:
      - 5001:5000
    environment:
      - FLASK_APP=project/__init__.py
      - FLASK_ENV=development

I am not sure what causes this problem, Please give your suggestions, Thanks

Понравилась статья? Поделить с друзьями:
  • Failover cluster manager windows 10 download
  • Failed with 0x57 retrieving appmodel runtime status for package windows
  • Failed to start the aladdin device driver windows 7
  • Failed to start denuvo driver error code 2148204812 windows 10
  • Failed to download required installation files java windows 7