ibm-messaging / mq-container

Container images for IBM® MQ
Apache License 2.0
248 stars 186 forks source link

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

Open jbcodeforce opened 2 years ago

jbcodeforce commented 2 years ago

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.

arthurbarr commented 2 years ago

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.

chughts commented 2 years ago

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
arthurbarr commented 2 years ago

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.

chughts commented 2 years ago
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
jbcodeforce commented 2 years ago

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