GitHub user tisonkun edited a discussion: Strange failure when build Pulsar Docker image on M1
These issues should be all answered by https://github.com/apache/pulsar/issues/12944#issuecomment-1103444708. When debugging https://github.com/apache/pulsar/issues/12944, I encounter several strange failures. Here I'll share them and see if others encounter them also. NOTE: These failures don't exist in CI. Thus I think they're strange. 1. `cannot create /usr/lib/jvm/java-17-openjdk-amd64/conf/security/java.security: Directory nonexistent` ``` [INFO] DOCKER> Step 14/25 : ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64 [INFO] DOCKER> [INFO] DOCKER> ---> Running in a47a209de148 [INFO] DOCKER> Removing intermediate container a47a209de148 [INFO] DOCKER> ---> 6a9d5c8543b8 [INFO] DOCKER> Step 15/25 : RUN echo networkaddress.cache.ttl=1 >> /usr/lib/jvm/java-17-openjdk-amd64/conf/security/java.security [INFO] DOCKER> [INFO] DOCKER> ---> Running in d55c15e90ed1 [INFO] DOCKER> [91m/bin/sh: 1: cannot create /usr/lib/jvm/java-17-openjdk-amd64/conf/security/java.security: Directory nonexistent [INFO] DOCKER> Removing intermediate container d55c15e90ed1 [ERROR] DOCKER> Unable to build image [apachepulsar/java-test-image] : "The command '/bin/sh -c echo networkaddress.cache.ttl=1 >> /usr/lib/jvm/java-17-openjdk-amd64/conf/security/java.security' returned a non-zero code: 2" ["The command '/bin/sh -c echo networkaddress.cache.ttl=1 >> /usr/lib/jvm/java-17-openjdk-amd64/conf/security/java.security' returned a non-zero code: 2" ] ``` After add `RUN mkdir -p /usr/lib/jvm/java-17-openjdk-amd64/conf/security` before `RUN echo networkaddress.cache.ttl=1 >> /usr/lib/jvm/java-17-openjdk-amd64/conf/security/java.security` in `docker/pulsar/Dockerfile` and `test/docker-images/java-test-image/Dockerfile`, this issue vanished. 2. `FileNotFoundError: [Errno 2] No such file or directory: 'cc'` ``` File "/tmp/pip-install-od2wltzl/grpcio/setup.py", line 149, in check_linker_need_libatomic cc_test = subprocess.Popen(['cc', '-x', 'c++', '-std=c++11', '-'], File "/usr/lib/python3.8/subprocess.py", line 858, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'cc' ``` See details in https://github.com/apache/pulsar/issues/12944#issuecomment-1219300666. Does `ubuntu:20.04` contain `cc`? If so, why does it fail on my local env. If not, why does it succeed in CI? 3. After I add `gcc` in the `apt install` list, it can find `cc`, but later it fails with `Python.h not found`. 4. After I add `python-dev` in the `apt install` list, it still fails with `Python.h not found`. cc @lhotari @nodece @michaeljmarshall GitHub link: https://github.com/apache/pulsar/discussions/17166 ---- This is an automatically sent email for dev@pulsar.apache.org. To unsubscribe, please send an email to: dev-unsubscr...@pulsar.apache.org