Connection timed out during build of Container-Image (probably due to corporate proxy)
1
We got a Connection timed out during build of a container image with https://github.com/mendix/docker-mendix-buildpack The docker host is behind a corporate proxy and a bypass is denied by the ops team. What would be the aproach to build the container image? Probably by creating a custom build image which inherits from mendix root build image? What configuration must be done in if this is the solution? In addition our proxy breaks up the ssl-conection what means that we probably have to import our corporate certificate into the root image...? Error-Log: sudo docker build \ > --build-arg CF_BUILDPACK_URL=http://artifactory.ads.vhv.de/artifactory/common-development-binary/medix/cf-mendix-buildpack/v4.15.4/cf-mendix-buildpack.zip \ > --tag mendix/mendix-buildpack:v1.2 . Sending build context to Docker daemon 58.99MB Step 1/37 : ARG ROOTFS_IMAGE=mendix/rootfs:ubi8 Step 2/37 : ARG BUILDER_ROOTFS_IMAGE=mendix/rootfs:bionic Step 3/37 : FROM ${BUILDER_ROOTFS_IMAGE} AS builder ---> 92710b115e47 Step 4/37 : ARG BUILD_PATH=project ---> Using cache ---> 0f158f8c48ef Step 5/37 : ARG DD_API_KEY ---> Using cache ---> c9f2b3aa1341 Step 6/37 : ARG CF_BUILDPACK=v4.15.4 ---> Using cache ---> f8e921253871 Step 7/37 : ARG CF_BUILDPACK_URL=https://github.com/mendix/cf-mendix-buildpack/releases/download/${CF_BUILDPACK}/cf-mendix-buildpack.zip ---> Using cache ---> 72872a1a81ef Step 8/37 : ARG EXCLUDE_LOGFILTER=true ---> Using cache ---> 7836d7fd39b8 Step 9/37 : ARG BLOBSTORE ---> Using cache ---> 3e625cd02e5d Step 10/37 : ARG BUILDPACK_XTRACE ---> Using cache ---> e7ba86dfad22 Step 11/37 : RUN mkdir -p /opt/mendix/buildpack /opt/mendix/build && echo "Downloading CF Buildpack from ${CF_BUILDPACK_URL}" && curl -fsSL ${CF_BUILDPACK_URL} -o /tmp/cf-mendix-buildpack.zip && python3 -m zipfile -e /tmp/cf-mendix-buildpack.zip /opt/mendix/buildpack/ && rm /tmp/cf-mendix-buildpack.zip && chgrp -R 0 /opt/mendix && chmod -R g=u /opt/mendix ---> Using cache ---> c3679535b330 Step 12/37 : COPY scripts/compilation scripts/git /opt/mendix/buildpack/ ---> Using cache ---> c05d62841000 Step 13/37 : COPY $BUILD_PATH /opt/mendix/build ---> Using cache ---> 3a45700e23bf Step 14/37 : RUN chmod +rx /opt/mendix/buildpack/bin/bootstrap-python && /opt/mendix/buildpack/bin/bootstrap-python /opt/mendix/buildpack /tmp/buildcache ---> Using cache ---> 58565c5a0f23 Step 15/37 : ENV PYTHONPATH "$PYTHONPATH:/opt/mendix/buildpack/lib/:/opt/mendix/buildpack/:/opt/mendix/buildpack/lib/python3.6/site-packages/" ---> Using cache ---> f84a9fad028f Step 16/37 : ENV NGINX_CUSTOM_BIN_PATH=/usr/sbin/nginx ---> Using cache ---> 32e10215557f Step 17/37 : RUN mkdir -p /tmp/buildcache /var/mendix/build /var/mendix/build/.local && chmod +rx /opt/mendix/buildpack/compilation /opt/mendix/buildpack/git /opt/mendix/buildpack/buildpack/stage.py && cd /opt/mendix/buildpack && ./compilation /opt/mendix/build /tmp/buildcache && rm -fr /tmp/buildcache /tmp/javasdk /tmp/opt /tmp/downloads /opt/mendix/buildpack/compilation /opt/mendix/buildpack/git && ln -s /opt/mendix/.java /opt/mendix/build && chgrp -R 0 /opt/mendix /var/mendix && chmod -R g=u /opt/mendix /var/mendix ---> [Warning] IPv4 forwarding is disabled. Networking will not work. ---> Running in d3591cc6f157 INFO: Mendix project compilation phase... INFO: Preflight check on Mendix runtime version [9.2.0.20531] and stack [None]... INFO: Preflight check completed INFO: Source push detected, starting MxBuild... INFO: Selecting Mono Runtime: mono-5.20.1.27 Traceback (most recent call last): File "/opt/mendix/buildpack/buildpack/mono.py", line 100, in ensure_and_get_mono mono_location = _get_mono_path("/tmp/opt", mono_version) File "/opt/mendix/buildpack/buildpack/mono.py", line 46, in _get_mono_path "Mono not found", File "/opt/mendix/buildpack/buildpack/util.py", line 188, in get_existing_directory_or_raise raise NotFoundException(error) buildpack.util.NotFoundException: Mono not found During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/mendix/buildpack/lib/python3.6/site-packages/urllib3/connection.py", line 160, in _new_conn (self._dns_host, self.port), self.timeout, **extra_kw File "/opt/mendix/buildpack/lib/python3.6/site-packages/urllib3/util/connection.py", line 61, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/usr/lib/python3.6/socket.py", line 745, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -3] Temporary failure in name resolution During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/mendix/buildpack/lib/python3.6/site-packages/urllib3/connectionpool.py", line 677, in urlopen chunked=chunked, File "/opt/mendix/buildpack/lib/python3.6/site-packages/urllib3/connectionpool.py", line 381, in _make_request self._validate_conn(conn) File "/opt/mendix/buildpack/lib/python3.6/site-packages/urllib3/connectionpool.py", line 978, in _validate_conn conn.connect() File "/opt/mendix/buildpack/lib/python3.6/site-packages/urllib3/connection.py", line 309, in connect conn = self._new_conn() File "/opt/mendix/buildpack/lib/python3.6/site-packages/urllib3/connection.py", line 172, in _new_conn self, "Failed to establish a new connection: %s" % e urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f34c146c048>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/mendix/buildpack/lib/python3.6/site-packages/requests/adapters.py", line 449, in send timeout=timeout File "/opt/mendix/buildpack/lib/python3.6/site-packages/urllib3/connectionpool.py", line 727, in urlopen method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] File "/opt/mendix/buildpack/lib/python3.6/site-packages/urllib3/util/retry.py", line 446, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='cdn.mendix.com', port=443): Max retries exceeded with url: /mx-buildpack/mono/mono-5.20.1.27-mx-ubuntu-bionic.tar.gz (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f34c146c048>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/mendix/buildpack/buildpack/stage.py", line 146, in <module> runtime.get_java_version(runtime_version), File "/opt/mendix/buildpack/buildpack/mxbuild.py", line 19, in stage mono_location = mono.ensure_and_get_mono(runtime_version, cache_path) File "/opt/mendix/buildpack/buildpack/mono.py", line 106, in ensure_and_get_mono cache_dir, File "/opt/mendix/buildpack/buildpack/util.py", line 102, in download_and_unpack download(url, cached_location) File "/opt/mendix/buildpack/buildpack/util.py", line 175, in download response = requests.get(url, stream=True) File "/opt/mendix/buildpack/lib/python3.6/site-packages/requests/api.py", line 76, in get return request('get', url, params=params, **kwargs) File "/opt/mendix/buildpack/lib/python3.6/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/opt/mendix/buildpack/lib/python3.6/site-packages/requests/sessions.py", line 542, in request resp = self.send(prep, **send_kwargs) File "/opt/mendix/buildpack/lib/python3.6/site-packages/requests/sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "/opt/mendix/buildpack/lib/python3.6/site-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='cdn.mendix.com', port=443): Max retries exceeded with url: /mx-buildpack/mono/mono-5.20.1.27-mx-ubuntu-bionic.tar.gz (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f34c146c048>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)) Traceback (most recent call last): File "./compilation", line 74, in <module> exit_code = call_buildpack_compilation() File "./compilation", line 37, in call_buildpack_compilation return subprocess.check_call(["/opt/mendix/buildpack/buildpack/stage.py", BUILD_PATH, CACHE_PATH]) File "/usr/lib/python3.6/subprocess.py", line 311, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/opt/mendix/buildpack/buildpack/stage.py', '/opt/mendix/build', '/tmp/buildcache']' returned non-zero exit status 1.