Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker compose fail on windows #10560

Closed
alexsiryi14 opened this issue May 12, 2023 · 3 comments
Closed

docker compose fail on windows #10560

alexsiryi14 opened this issue May 12, 2023 · 3 comments
Assignees
Labels

Comments

@alexsiryi14
Copy link

Description

docker compose on windows 10 failed with the stack trace:

panic: interface conversion: *windowsconsole.ansiWriter is not console.File: missing method Close

goroutine 1 [running]:
github.com/docker/compose/v2/pkg/progress.NewWriter({0x2428180, 0xc0000d0960}, {0x240bca0?, 0xc00015d140})
        github.com/docker/compose/v2/pkg/progress/writer.go:115 +0xc9
github.com/docker/compose/v2/pkg/progress.RunWithStatus({0x2428180, 0xc0000d0960}, 0xc000659ef0, {0x240bca0, 0xc00015d140})
        github.com/docker/compose/v2/pkg/progress/writer.go:71 +0xa5
github.com/docker/compose/v2/pkg/progress.Run({0x2428180, 0xc0000d0960}, 0xc0003fa440, {0x240bca0, 0xc00015d140})
        github.com/docker/compose/v2/pkg/progress/writer.go:62 +0x85
github.com/docker/compose/v2/pkg/compose.(*composeService).Up(0xc0003fb160, {0x2428180, 0xc0000d0960}, 0xc0000c96b0, {{{0x33d4128, 0x0, 0x0}, 0x0, 0x0, {0x21057a8, ...}, ...}, ...})
        github.com/docker/compose/v2/pkg/compose/up.go:34 +0x172
github.com/docker/compose/v2/pkg/api.(*ServiceProxy).Up(0xc0003aa0f0, {0x2428180, 0xc0000d0960}, 0x0?, {{{0x33d4128, 0x0, 0x0}, 0x0, 0x0, {0x21057a8, ...}, ...}, ...})
        github.com/docker/compose/v2/pkg/api/proxy.go:181 +0x14a
github.com/docker/compose/v2/cmd/compose.runUp({0x2428180?, 0xc0000d0960}, {0x1b0336ddbd8, 0xc000186500}, {0x243f310, _}, {0x0, 0x0, {0x2104070, 0x7}, ...}, ...)
        github.com/docker/compose/v2/cmd/compose/up.go:196 +0x89d
github.com/docker/compose/v2/cmd/compose.upCommand.func2({0x2428180, 0xc0000d0960}, 0xc0000c96b0, {0x33d4128, 0x0, 0x0})
        github.com/docker/compose/v2/cmd/compose/up.go:89 +0x1e5
github.com/docker/compose/v2/cmd/compose.(*ProjectOptions).WithServices.func1({0x2428180, 0xc0000d0960}, {0x33d4128, 0x0, 0x0})
        github.com/docker/compose/v2/cmd/compose/compose.go:127 +0xd7
github.com/docker/compose/v2/cmd/compose.Adapt.func1({0x2428180?, 0xc0000d0960?}, 0x2?, {0x33d4128?, 0x1?, 0x0?})
        github.com/docker/compose/v2/cmd/compose/compose.go:92 +0x36
github.com/docker/compose/v2/cmd/compose.AdaptCmd.func1(0xc0003b3800, {0x33d4128, 0x0, 0x0})
        github.com/docker/compose/v2/cmd/compose/compose.go:71 +0x21c
github.com/spf13/cobra.(*Command).execute(0xc0003b3800, {0xc0003fb6d0, 0x0, 0x0})
        github.com/spf13/cobra@v1.7.0/command.go:940 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0xc000121200)
        github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.7.0/command.go:992
github.com/docker/cli/cli-plugins/plugin.RunPlugin(0xc0006bfe28?, 0xc0003b3500, {{0x2100181, 0x5}, {0x21099aa, 0xb}, {0x24056d0, 0x7}, {0x0, 0x0}, ...})
        github.com/docker/cli@v23.0.4+incompatible/cli-plugins/plugin/plugin.go:51 +0x130
github.com/docker/cli/cli-plugins/plugin.Run(0x2224388, {{0x2100181, 0x5}, {0x21099aa, 0xb}, {0x24056d0, 0x7}, {0x0, 0x0}, {0x0, ...}, ...})
        github.com/docker/cli@v23.0.4+incompatible/cli-plugins/plugin/plugin.go:64 +0xee
main.pluginMain()
        github.com/docker/compose/v2/cmd/main.go:36 +0xdf
main.main()
        github.com/docker/compose/v2/cmd/main.go:68 +0x198

Steps To Reproduce

docker-compose.yml which i'm trying to build:

version: '3'
services:
  db:
    image: postgres:12-alpine
    container_name: demo-proj-12pg
    volumes:
      - postgres_data:/var/lib/postgresql/data
    command: 
      "postgres -c 'max_connections=500'"
    environment:
      - POSTGRES_DB=${POSTGRES_DB}
      - POSTGRES_USER=${POSTGRES_USER}
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
    ports:
      - "5432:5432"
  demo-web:
    build: .
    command: "./bin/rails server"
    environment:
      - RAILS_ENV=${RAILS_ENV}
      - POSTGRES_HOST=${POSTGRES_HOST}
      - POSTGRES_DB=${POSTGRES_DB}
      - POSTGRES_USER=${POSTGRES_USER}
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
    volumes:
      - app-storage:/rails/storage
    depends_on:
      - db
    ports:
      - "3000:3000"

volumes:
  postgres_data: {}
  app-storage: {}

Compose Version

Docker Compose version v2.17.3

Docker Environment

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.4
    Path:     C:\Program Files\Docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.17.3
    Path:     C:\Program Files\Docker\cli-plugins\docker-compose.exe
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-dev.exe
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.19
    Path:     C:\Program Files\Docker\cli-plugins\docker-extension.exe
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v0.1.0-beta.4
    Path:     C:\Program Files\Docker\cli-plugins\docker-init.exe
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-sbom.exe
  scan: Docker Scan (Docker Inc.)
    Version:  v0.26.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-scan.exe
  scout: Command line tool for Docker Scout (Docker Inc.)
    Version:  v0.10.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-scout.exe

Server:
 Containers: 1
  Running: 0
  Paused: 0
  Stopped: 1
 Images: 1
 Server Version: 23.0.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 2806fc1057397dbaeefbea0e4e17bddfbd388f38
 runc version: v1.1.5-0-gf19387a
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.49-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 1.938GiB
 Name: docker-desktop
 ID: 09bd99b6-de4a-42db-9516-0b3f6ea109a1
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

Possibly that's a fault in a configuration/environment or something else, but can't find a similar question.

@alexsiryi14
Copy link
Author

alexsiryi14 commented May 12, 2023

The problem is in using a windows terminal which can't normally work with an ansi-codes.
git bash is ok!

@ndeloof
Copy link
Contributor

ndeloof commented May 14, 2023

Do you have any issue running docker buildx bulid ... in your windows terminal (with any Dockerfile) ?
buildx should have a comparable requirement and I'm not aware of such a limitation

we should at least avoid a panic here and fallpack to plain text output if we can't convert terminal file descriptor into the required type

@ndeloof
Copy link
Contributor

ndeloof commented Jan 31, 2024

Closing as requester didn't answered

@ndeloof ndeloof closed this as completed Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants