-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Describe the bug
Hi,
We use az-cli docker image and then install npm and then install CDKTF npm package on top. Docker Image azure-cli:2.56.0 not supporting installation of CDKTF npm package. Till 2.55.0, it used to work. I could see lib6-compat pkgconf two packages have been removed and gcompat libucontext musl-obstack 3 packages got added newly in 2.56.0 compared to 2.55.0.
We had to use az-cli because of the reduced image size. Please check this issue.
Related command
Dockerfile
# syntax=docker/dockerfile:1.4
FROM mcr.microsoft.com/azure-cli:2.56.0
# Install latest Terraform CLI
RUN apk add curl
RUN release=`curl -s https://api.github.com/repos/hashicorp/terraform/releases/latest | grep tag_name | cut -d: -f2 | tr -d \"\,\v | awk '{$1=$1};1'` \
&& wget https://releases.hashicorp.com/terraform/${release}/terraform_${release}_linux_amd64.zip \
&& unzip terraform_${release}_linux_amd64.zip \
&& mv terraform /usr/bin/terraform \
&& rm -f terraform_${release}_linux_amd64.zip
# Install latest CDKTF CLI
RUN apk add --update npm
RUN npm install -g cdktf-cli@latest
CMD ["cdktf"]
Execute: docker buildx build -t azcli-2.56.0 .
Errors
$sudo docker buildx build -t azcli-2.56.0 .
[+] Building 66.9s (11/11) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 656B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> resolve image config for docker.io/docker/dockerfile:1.4 1.0s
=> CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a858632727cf7a112fbfd19b17e94c4e84ced81e24ef1a0dbc 0.0s
=> [internal] load metadata for mcr.microsoft.com/azure-cli:2.55.0 0.2s
=> CACHED [1/5] FROM mcr.microsoft.com/azure-cli:2.55.0@sha256:7bb90fd8f591a42da997d85522b478849e57e59373c65b7b5136226bc69a2917 0.0s
=> [2/5] RUN apk add curl 1.2s
=> [3/5] RUN release=`curl -s https://api.github.com/repos/hashicorp/terraform/releases/latest | grep tag_name | cut -d: -f2 | tr -d ",v | awk '{$1=$1};1'` && wget https://release 2.4s
=> [4/5] RUN apk add --update npm 1.9s
=> [5/5] RUN npm install -g cdktf-cli@latest 34.8s
=> exporting to image 25.2s
=> => exporting layers 25.2s
=> => writing image sha256:7fcba4c8b70e202af2ae0f43834864204a748c0e2a82ec74cfe0d8d1f24770c3 0.0s
=> => naming to docker.io/library/azcli-2.55.0 0.0s
pipelineagentadmin@vmss-ofm-prod-dmlz-iac-weu000000:~/test$ vi Dockerfile
pipelineagentadmin@vmss-ofm-prod-dmlz-iac-weu000000:~/test$ sudo docker buildx build -t azcli-2.56.0 .
[+] Building 109.6s (10/10) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 656B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> resolve image config for docker.io/docker/dockerfile:1.4 0.5s
=> CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a858632727cf7a112fbfd19b17e94c4e84ced81e24ef1a0dbc 0.0s
=> [internal] load metadata for mcr.microsoft.com/azure-cli:2.56.0 0.6s
=> [1/5] FROM mcr.microsoft.com/azure-cli:2.56.0@sha256:88e032ed2623fa2ce4e5cba8cba5eb095147a9d4929c477a4e2a5aa53d41600d 59.1s
=> => resolve mcr.microsoft.com/azure-cli:2.56.0@sha256:88e032ed2623fa2ce4e5cba8cba5eb095147a9d4929c477a4e2a5aa53d41600d 0.0s
=> => sha256:88e032ed2623fa2ce4e5cba8cba5eb095147a9d4929c477a4e2a5aa53d41600d 772B / 772B 0.0s
=> => sha256:aec6b60e9a8cffac04db88b753fc2c29189dd56b152792b1d8549f3adae67067 10.06kB / 10.06kB 0.0s
=> => sha256:661ff4d9561e3fd050929ee5097067c34bafc523ee60f5294a37fd08056a73ca 3.41MB / 3.41MB 0.9s
=> => sha256:44cda88cd45dc00d3349d343b46e92f0d55daa059d276f3ecf860c174bbedf81 621.69kB / 621.69kB 0.4s
=> => sha256:a2587568e80b0693fd4ce902e114201383da4ecd46a6d0e1f7a19d0770ae55a9 1.79kB / 1.79kB 0.0s
=> => sha256:2cbca0db7eef4ddd941d8f0dff5097298336bf1032e263345b4b22d867af20f5 12.63MB / 12.63MB 5.0s
=> => sha256:5c03c2d3628123d69882e905d7b62bd45e65a020014d05ab579009efa19f39dc 241B / 241B 0.5s
=> => sha256:b7fa17f943fbc60ea7f335dd8c66e3a2fa2d5335a9d25d9ae49f091a1f8025ef 3.11MB / 3.11MB 1.4s
=> => extracting sha256:661ff4d9561e3fd050929ee5097067c34bafc523ee60f5294a37fd08056a73ca 0.1s
=> => sha256:a9732944be14d3a0e089a502bc79a5474c38bcb4801bf7a87ea04bc6e0da5082 188.49MB / 188.49MB 45.8s
=> => extracting sha256:44cda88cd45dc00d3349d343b46e92f0d55daa059d276f3ecf860c174bbedf81 0.2s
=> => sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 32B / 32B 1.5s
=> => extracting sha256:2cbca0db7eef4ddd941d8f0dff5097298336bf1032e263345b4b22d867af20f5 0.6s
=> => extracting sha256:5c03c2d3628123d69882e905d7b62bd45e65a020014d05ab579009efa19f39dc 0.0s
=> => extracting sha256:b7fa17f943fbc60ea7f335dd8c66e3a2fa2d5335a9d25d9ae49f091a1f8025ef 0.3s
=> => extracting sha256:a9732944be14d3a0e089a502bc79a5474c38bcb4801bf7a87ea04bc6e0da5082 12.4s
=> => extracting sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 0.0s
=> [2/5] RUN apk add curl 1.4s
=> [3/5] RUN release=`curl -s https://api.github.com/repos/hashicorp/terraform/releases/latest | grep tag_name | cut -d: -f2 | tr -d ",v | awk '{$1=$1};1'` && wget https://release 2.4s
=> [4/5] RUN apk add --update npm 1.7s
=> ERROR [5/5] RUN npm install -g cdktf-cli@latest 43.7s
------
> [5/5] RUN npm install -g cdktf-cli@latest:
43.56 npm ERR! code 1
43.56 npm ERR! path /usr/local/lib/node_modules/cdktf-cli/node_modules/@cdktf/node-pty-prebuilt-multiarch
43.57 npm ERR! command failed
43.57 npm ERR! command sh -c node scripts/check-prebuild.js || prebuild-install || node scripts/install.js
43.57 npm ERR! Prebuild binary missing for platform linux
43.57 npm ERR! prebuild-install warn install No prebuilt binaries found (target=21.4.0 runtime=node arch=x64 libc=musl platform=linux)
43.57 npm ERR! gyp info it worked if it ends with ok
43.57 npm ERR! gyp info using [email protected]
43.58 npm ERR! gyp info using [email protected] | linux | x64
43.58 npm ERR! gyp info find Python using Python version 3.11.7 found at "/usr/local/bin/python3"
43.58 npm ERR! gyp http GET https://nodejs.org/download/release/v21.4.0/node-v21.4.0-headers.tar.gz
43.58 npm ERR! gyp http 200 https://nodejs.org/download/release/v21.4.0/node-v21.4.0-headers.tar.gz
43.58 npm ERR! gyp http GET https://nodejs.org/download/release/v21.4.0/SHASUMS256.txt
43.58 npm ERR! gyp http 200 https://nodejs.org/download/release/v21.4.0/SHASUMS256.txt
43.58 npm ERR! gyp info spawn /usr/local/bin/python3
43.58 npm ERR! gyp info spawn args [
43.58 npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
43.58 npm ERR! gyp info spawn args 'binding.gyp',
43.58 npm ERR! gyp info spawn args '-f',
43.58 npm ERR! gyp info spawn args 'make',
43.58 npm ERR! gyp info spawn args '-I',
43.58 npm ERR! gyp info spawn args '/usr/local/lib/node_modules/cdktf-cli/node_modules/@cdktf/node-pty-prebuilt-multiarch/build/config.gypi',
43.58 npm ERR! gyp info spawn args '-I',
43.58 npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
43.58 npm ERR! gyp info spawn args '-I',
43.58 npm ERR! gyp info spawn args '/root/.cache/node-gyp/21.4.0/include/node/common.gypi',
43.58 npm ERR! gyp info spawn args '-Dlibrary=shared_library',
43.58 npm ERR! gyp info spawn args '-Dvisibility=default',
43.58 npm ERR! gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/21.4.0',
43.58 npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
43.58 npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/21.4.0/<(target_arch)/node.lib',
43.58 npm ERR! gyp info spawn args '-Dmodule_root_dir=/usr/local/lib/node_modules/cdktf-cli/node_modules/@cdktf/node-pty-prebuilt-multiarch',
43.58 npm ERR! gyp info spawn args '-Dnode_engine=v8',
43.58 npm ERR! gyp info spawn args '--depth=.',
43.58 npm ERR! gyp info spawn args '--no-parallel',
43.58 npm ERR! gyp info spawn args '--generator-output',
43.58 npm ERR! gyp info spawn args 'build',
43.58 npm ERR! gyp info spawn args '-Goutput_dir=.'
43.58 npm ERR! gyp info spawn args ]
43.58 npm ERR! gyp ERR! build error
43.58 npm ERR! gyp ERR! stack Error: not found: make
43.58 npm ERR! gyp ERR! stack at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/lib/index.js:16:17)
43.58 npm ERR! gyp ERR! stack at which (/usr/lib/node_modules/npm/node_modules/which/lib/index.js:77:9)
43.58 npm ERR! gyp ERR! stack at async doWhich (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:112:22)
43.58 npm ERR! gyp ERR! stack at async loadConfigGypi (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:77:7)
43.58 npm ERR! gyp ERR! stack at async build (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:35:3)
43.58 npm ERR! gyp ERR! stack at async run (/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js:81:18)
43.58 npm ERR! gyp ERR! System Linux 6.2.0-1018-azure
43.58 npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
43.58 npm ERR! gyp ERR! cwd /usr/local/lib/node_modules/cdktf-cli/node_modules/@cdktf/node-pty-prebuilt-multiarch
43.58 npm ERR! gyp ERR! node -v v21.4.0
43.58 npm ERR! gyp ERR! node-gyp -v v10.0.1
43.58 npm ERR! gyp ERR! not ok
43.58
43.58 npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-01-12T13_00_14_468Z-debug-0.log
------
Dockerfile:13
--------------------
11 | # Install latest CDKTF CLI
12 | RUN apk add --update npm
13 | >>> RUN npm install -g cdktf-cli@latest
14 | CMD ["cdktf"]
15 |
--------------------
ERROR: failed to solve: process "/bin/sh -c npm install -g cdktf-cli@latest" did not complete successfully: exit code: 1
$
Issue script & Debug output
Same as above
Expected behavior
$sudo docker buildx build -t azcli-2.55.0 .
[+] Building 66.9s (11/11) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 656B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> resolve image config for docker.io/docker/dockerfile:1.4 1.0s
=> CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a858632727cf7a112fbfd19b17e94c4e84ced81e24ef1a0dbc 0.0s
=> [internal] load metadata for mcr.microsoft.com/azure-cli:2.55.0 0.2s
=> CACHED [1/5] FROM mcr.microsoft.com/azure-cli:2.55.0@sha256:7bb90fd8f591a42da997d85522b478849e57e59373c65b7b5136226bc69a2917 0.0s
=> [2/5] RUN apk add curl 1.2s
=> [3/5] RUN release=`curl -s https://api.github.com/repos/hashicorp/terraform/releases/latest | grep tag_name | cut -d: -f2 | tr -d ",v | awk '{$1=$1};1'` && wget https://release 2.4s
=> [4/5] RUN apk add --update npm 1.9s
=> [5/5] RUN npm install -g cdktf-cli@latest 34.8s
=> exporting to image 25.2s
=> => exporting layers 25.2s
=> => writing image sha256:7fcba4c8b70e202af2ae0f43834864204a748c0e2a82ec74cfe0d8d1f24770c3 0.0s
=> => naming to docker.io/library/azcli-2.55.0 0.0s
$
Environment Summary
azure-cli 2.56.0
core 2.56.0
telemetry 1.1.0
Dependencies:
msal 1.24.0b2
azure-mgmt-resource 23.1.0b2
Python location '/opt/az/bin/python3'
Extensions directory '/home/pipelineagentadmin/.azure/cliextensions'
Python (Linux) 3.11.5 (main, Jan 8 2024, 09:08:13) [GCC 11.4.0]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
No response