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

Compose V2 v2.2.3+: Cannot run docker-compose if a container uses build: #13889

Closed
nyonson opened this issue Apr 15, 2022 · 7 comments
Closed
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@nyonson
Copy link

nyonson commented Apr 15, 2022

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Beginning with docker-compose v2 v2.2.3, if any container has a build: directive, docker-compose fails to start.

Steps to reproduce the issue:

FROM alpine:latest

RUN echo 1
services:
  test:
    build: .
    command: ls /app

Describe the results you received:

$ docker-compose up                                                                               
[+] Building 0.0s (0/0)                                                                                                                                           
listing workers for Build: failed to list workers: Unavailable: connection error: desc = "transport: Error while dialing unable to upgrade to h2c, received 404"

Describe the results you expected:

This should build and run.

Additional information you deem important (e.g. issue happens only occasionally):

Was working before docker compose v2.2.3.

Output of podman version:

$ podman version             
Client:       Podman Engine
Version:      4.0.3
API Version:  4.0.3
Go Version:   go1.18
Git Commit:   62534053086fdeba7b93117e7c4dc6e797835a3e
Built:        Mon Apr  4 05:54:02 2022
OS/Arch:      linux/amd64

Output of podman info --debug:

$ podman info --debug
host:
  arch: amd64
  buildahVersion: 1.24.3
  cgroupControllers:
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: /usr/bin/conmon is owned by conmon 1:2.1.0-1
    path: /usr/bin/conmon
    version: 'conmon version 2.1.0, commit: bdb4f6e56cd193d40b75ffc9725d4b74a18cb33c'
  cpus: 8
  distribution:
    distribution: arch
    version: unknown
  eventLogger: journald
  hostname: mercury3
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.16.16-arch1-1-surface
  linkmode: dynamic
  logDriver: journald
  memFree: 9190539264
  memTotal: 16353726464
  networkBackend: cni
  ociRuntime:
    name: crun
    package: /usr/bin/crun is owned by crun 1.4.4-1
    path: /usr/bin/crun
    version: |-
      crun version 1.4.4
      commit: 6521fcc5806f20f6187eb933f9f45130c86da230
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /etc/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: /usr/bin/slirp4netns is owned by slirp4netns 1.1.12-1
    version: |-
      slirp4netns version 1.1.12
      commit: 7a104a101aa3278a2152351a082a6df71f57c9a3
      libslirp: 4.6.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.3
  swapFree: 0
  swapTotal: 0
  uptime: 10h 56m 45.09s (Approximately 0.42 days)
plugins:
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries: {}
store:
  configFile: /home/njohnson/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/njohnson/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 15
  runRoot: /run/user/1000/containers
  volumePath: /home/njohnson/.local/share/containers/storage/volumes
version:
  APIVersion: 4.0.3
  Built: 1649076842
  BuiltTime: Mon Apr  4 05:54:02 2022
  GitCommit: 62534053086fdeba7b93117e7c4dc6e797835a3e
  GoVersion: go1.18
  OsArch: linux/amd64
  Version: 4.0.3

Package info (e.g. output of rpm -q podman or apt list podman):

$ pacman -Qi podman  
Name            : podman
Version         : 4.0.3-1
Description     : Tool and library for running OCI-based containers in pods
Architecture    : x86_64
URL             : https://github.com/containers/podman
Licenses        : Apache
Groups          : None
Provides        : None
Depends On      : conmon  containers-common  crun  iptables
                  libdevmapper.so=1.02-64  libgpgme.so=11-64
                  libseccomp.so=2-64  slirp4netns
Optional Deps   : apparmor: for AppArmor support
                  btrfs-progs: support btrfs backend devices
                  catatonit: --init flag support
                  netavark: for a new container-network-stack implementation
                  podman-compose: for docker-compose compatibility
                  podman-docker: for Docker-compatible CLI [installed]
Required By     : podman-docker
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 67.98 MiB
Packager        : David Runge <dvzrv@archlinux.org>
Build Date      : Mon 04 Apr 2022 05:54:02 AM PDT
Install Date    : Mon 04 Apr 2022 12:41:31 PM PDT
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):

Physical host, running rootless.

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 15, 2022
@CRThaze
Copy link

CRThaze commented Apr 20, 2022

This begins for you at v2.2.3? For me it was fixed by downgrading to v2.2.3

@mheon
Copy link
Member

mheon commented Apr 20, 2022

All evidence I have indicates that 2.2.3 is the last safe release.

@Luap99
Copy link
Member

Luap99 commented Apr 28, 2022

I think you have to set DOCKER_BUILDKIT=0 env var to disable the use of the buildkit API. This works for me.

@Haarolean
Copy link

I have the same problem running a compose with build stuff on Apple M1 with podman 4.0.3. The same compose works fine with MacOS on Intel with podman 4.0.3.

@larssped
Copy link

larssped commented May 16, 2022

I think you have to set DOCKER_BUILDKIT=0 env var to disable the use of the buildkit API. This works for me.

This worked for me as well

EDIT: M1 mac, docker-compose version 2.5.0

@mheon
Copy link
Member

mheon commented May 16, 2022

I'm going to say DOCKER_BUILDKIT=0 is the official fix until we implement the API, and close given that.

@mheon mheon closed this as completed May 16, 2022
dgoffredo added a commit to DataDog/nginx-datadog that referenced this issue Jul 28, 2022
florianjiri added a commit to florianjiri/packing-task-stub that referenced this issue Aug 8, 2022
@rezadhah
Copy link

rezadhah commented Apr 5, 2023

Sadly it does'nt work for me with envar DOCKER_BUILDKIT=0

$ sudo systemctl status podman.socket
● podman.socket - Podman API Socket
     Loaded: loaded (/lib/systemd/system/podman.socket; enabled; vendor preset: enabled)
     Active: active (listening) since Wed 2023-04-05 11:15:44 WIB; 41min ago
   Triggers: ● podman.service
       Docs: man:podman-system-service(1)
     Listen: /run/podman/podman.sock (Stream)
     CGroup: /system.slice/podman.socket

$ sudo docker-compose -H unix:///run/podman/podman.sock up
[+] Building 0.0s (0/0)
listing workers for Build: failed to list workers: Unavailable: connection error: desc = "transport: Error while dialing unable to upgrade to h2c, received 404"

here's my setup

$ podman --version
podman version 3.4.4

$ sudo systemctl status podman.socket
● podman.socket - Podman API Socket
     Loaded: loaded (/lib/systemd/system/podman.socket; enabled; vendor preset: enabled)
     Active: active (listening) since Wed 2023-04-05 11:15:44 WIB; 43min ago
   Triggers: ● podman.service
       Docs: man:podman-system-service(1)
     Listen: /run/podman/podman.sock (Stream)
     CGroup: /system.slice/podman.socket

$ docker-compose --version
Docker Compose version v2.5.0

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Aug 28, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

7 participants