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

[BUG] docker-compose up error #10187

Closed
phelippe opened this issue Jan 21, 2023 · 3 comments
Closed

[BUG] docker-compose up error #10187

phelippe opened this issue Jan 21, 2023 · 3 comments
Labels

Comments

@phelippe
Copy link

phelippe commented Jan 21, 2023

Description

when trying to run docker-compose up --build (or without --build) is returning this error docker endpoint for "default" not found

my Dockerfile

FROM node:19-alpine As base

WORKDIR /usr/src/app

COPY [ "package*.json", "./" ]

FROM base AS dev

ENV NODE_ENV=development
RUN npm install
COPY . .
CMD [ "npm", "run", "start:dev" ]

FROM base AS prod

ENV NODE_ENV=production
RUN npm install --production
COPY . .
RUN npm i -g @nestjs/cli
RUN npm run build
CMD [ "npm", "run", "start:prod" ]

My docker-compose.yml file:

version: "3.9"
services:
  mysql:
    image: mysql
    command: --default-authentication-plugin=mysql_native_password
    restart: always
    environment:
      MYSQL_DATABASE: ${DB_DATABASE_NAME}
      MYSQL_USER: ${DB_USERNAME}
      MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
    ports:
      - "${DB_PORT}:${DB_PORT}"
    volumes:
      - .db-data:/var/lib/mysql

  backend:
    build:
      context: .
      dockerfile: Dockerfile
      target: dev
    working_dir: /usr/src/app
    restart: always
    container_name: nestjs-docker
    ports:
      - "${SERVER_PORT}:${SERVER_PORT}"
      - "3003:9229"
    expose:
      - "${SERVER_PORT}"
    volumes:
      - ./src:/app
    links:
      - mysql:${DATABASE_CONNECTOR}
    depends_on:
      - mysql
    env_file: .env

.env file (might to help somehow):

SERVER_PORT=3002
DB_HOST=localhost
DB_PORT=3306
DB_USERNAME=test_docker
DB_PASSWORD=1234
DB_DATABASE_NAME=test_docker

Steps To Reproduce

On my WSL2 guest Ubuntu, when I run docker-compose up --build you should get the docker endpoint for "default" not found error as return

Compose Version

Docker Compose version v2.15.1

Docker Environment

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.10.0)
  compose: Docker Compose (Docker Inc., v2.15.1)
  dev: Docker Dev Environments (Docker Inc., v0.0.5)
  extension: Manages Docker extensions (Docker Inc., v0.2.17)
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
  scan: Docker Scan (Docker Inc., v0.23.0)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 4
 Server Version: 20.10.22
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 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 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 9ba4b250366a5ddde94bb7c9d1def331423aa323
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.15.79.1-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 15.59GiB
 Name: docker-desktop
 ID: BH4C:XB35:AGJF:OYTX:XZWY:XFQY:NAW3:OYKT:TR5V:6UY4:F5L5:F34K
 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/
 Labels:
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5000
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support

Anything else?

Edition Windows 11 Pro
Version 22H2
Installed on ‎1/‎9/‎2023
OS build 22621.1105
Experience Windows Feature Experience Pack 1000.22638.1000.0

Docker version on host
image

After many tests, I can say the problem is at docker-compose.yml->backend->build, if I try to use dockerfile it doesn't recognize, but it is the way the docs says:

@ndeloof
Copy link
Contributor

ndeloof commented Jan 23, 2023

Please check your builkit builders configuration by running docker buildx ls
it should show you status for the default builder begin currently selected:

default *           docker                                        
  default           default                     running  20.10.21 linux/arm64, linux/amd64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6

@ganesh-rao
Copy link

I'm having the same error too.

This appears to be a temporary workaround for now:
#9956 (comment)

#9956 should not have been closed.

@laurazard
Copy link
Contributor

As this isn't a Compose issue per se (more a Docker Desktop issue, as explained here – #9956 (comment)), #9956 was correctly closed, and progress there and be followed on docker/for-win#12561.

Compose does not manage Contexts, and as such this cannot be fixed here.

@laurazard laurazard closed this as not planned Won't fix, can't repro, duplicate, stale Jan 29, 2023
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

4 participants