mq-container icon indicating copy to clipboard operation
mq-container copied to clipboard

make build-advancedserver fails due to docker build is not supporting --network anymore

Open jbcodeforce opened this issue 2 years ago • 5 comments

Hi As you can see in this note https://github.com/docker/buildx/issues/591 --network is not more supported in docker build

to reproduce run:

make build-advancedserver

you should get Error response from daemon: network mode "build" not supported by buildkit

changing the Makefile by removing --network build in the line:

$(eval EXTRA_ARGS=$(if $(findstring docker,$(COMMAND)), --build-arg MQ_URL=http://build:8080/$4, --volume $(DOWNLOADS_DIR):/var/downloads --build-arg MQ_URL=file:///var/downloads/$4))

of the function build-ibmmq works better.

jbcodeforce avatar Jul 14 '22 01:07 jbcodeforce

If you use the Makefile, it shouldn't be using Docker BuildKit, as we specifically disable it — if it's still enabled for you, it would be interesting to know what your build environment I (e.g. Docker version and OS), so we can understand why it's not disabled.

I'm not sure I understand your suggestion. I think the reasons we originally used the custom network were:

  1. Prevent opening ports on the host machine's network. By using a custom network, the ports are only accessible on the local machine
  2. To get the DNS alias, which is inserted by Docker.

It may be that things have moved on in Docker to allow these by other ways, which we should look into.

arthurbarr avatar Jul 14 '22 08:07 arthurbarr

I build on my MacOS X86 machine, Docker Desktop 3.4, and I have to run with

DOCKER_BUILDKIT=0 make build-devserver

If I don't specify DOCKER_BUILDKIT=0 I get the error:

Error response from daemon: network mode "build" not supported by buildkit

chughts avatar Jul 14 '22 09:07 chughts

What version of make are you using? I wonder if there's a bug in make which is causing the environment variable to not get passed through.

arthurbarr avatar Jul 14 '22 10:07 arthurbarr

GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0

chughts avatar Jul 14 '22 10:07 chughts

I am on mac / amd64. Using the flag export DOCKER_BUILDKIT=0, make the build working now. Thank you

jbcodeforce avatar Jul 14 '22 14:07 jbcodeforce