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

2.1.0 seemed to revert build output improvements #8876

Closed
matthewarmand opened this issue Nov 3, 2021 · 9 comments
Closed

2.1.0 seemed to revert build output improvements #8876

matthewarmand opened this issue Nov 3, 2021 · 9 comments

Comments

@matthewarmand
Copy link
Contributor

Description

In 2.0.0 (and 2.0.1) the build output changed from how it looked in v1 to one more richly colored, with collapsed sections for each step in the build. 2.1.0 appears to have reverted that. Is this option now hidden behind some config? Has it been reverted due to some issue? Or was this an unintentional change?

Steps to reproduce the issue:

  1. run docker compose build

Describe the results you received:

The output looks like compose v1 (not much coloring, continually prints to the screen rather than collapsing different sections and condensing output.

Describe the results you expected:

I expected the colored and section-collapsed output I experienced with version 2.0.1

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

Output of docker compose version:

Docker Compose version 2.1.0

Output of docker info:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Build with BuildKit (Docker Inc., v0.6.1-docker)
  compose: Docker Compose (Docker Inc., 2.1.0)

Server:
 Containers: 23
  Running: 1
  Paused: 0
  Stopped: 22
 Images: 15
 Server Version: 20.10.10
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: false
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 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 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 8686ededfc90076914c5238eb96c883ea093a8ba.m
 runc version: v1.0.2-0-g52b36a2d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.14.15-arch1-1
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 15.38GiB
 Name: marmand-metametrics
 ID: MFT5:LLSR:7C2C:EKIR:SQCQ:JPP7:XD3Y:IH2L:XUEX:3NUP:RT6L:XRRG
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Additional environment details:

N/A, let me know if you need to know anything else

@matthewarmand
Copy link
Contributor Author

As extra input in case this helps, down, up, and run are all still v2-esque in their output. Only build seems to have rolled back

@ndeloof
Copy link
Contributor

ndeloof commented Nov 4, 2021

build output is the one from buildkit, which is also used by docker build and docker-compose V1 when buildkit is enabled

@ndeloof
Copy link
Contributor

ndeloof commented Nov 4, 2021

I guess this is a side effect for #8818 cc @ulyssessouza

@in-principio
Copy link

It seems like Docker BuildKit was enabled by default in 2.0 and now is disabled by default in 2.1.

I was able to restore the previous behaviour by simply setting the environment variable DOCKER_BUILDKIT=1.

So:

DOCKER_BUILDKIT=1 docker-compose up --build

(If you run with sudo, make sure you put sudo before DOCKER_BUILDKIT=1)

@ndeloof
Copy link
Contributor

ndeloof commented Nov 4, 2021

yes, with #8818 buildkit is only used when configured to, which should be the default on any recent docker installation

@ndeloof ndeloof closed this as completed Nov 4, 2021
@matthewarmand
Copy link
Contributor Author

Thanks for the behavior fix @in-principio and the clarification @ndeloof. I appreciate that this is an intentional behavior change, am I right in assuming that the reason docker compose run, up, and down still look "buildkit-y" because they're just styled to mimic it, and they don't actually interact with buildkit at all? This is more just for my own curiosity than anything.

@ndeloof
Copy link
Contributor

ndeloof commented Nov 4, 2021

yes, the "progress" renderer on up and down is based on same UI components designed for buildx, while it's not using it to run those commands

@AleksaC
Copy link

AleksaC commented Nov 4, 2021

I was confused after reading this issue because I thought I had buildkit enabled but compose v2.1 still used the old build. It turns out I have installed buildx but buildkit wasn't enabled in the deamon so compose used the old build.

@ndeloof Could/should buildkit be used for builds if buildx is installed (to replace the docker build command not just as a plugin). It'd be easy to check if buildx is available like it's done with snyk but I'm not sure if it can be easily detected if it is set as the default builder. Maybe even buildx itself could be used for building if it's set as the default builder.

@ndeloof
Copy link
Contributor

ndeloof commented Nov 5, 2021

buildkit should be used if buildkit is enabled (either client side with DOCKER_BUILDKIT=1 or engine side by daemon configuration. Same as plain docker build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants