Skip to content

Docker build for azure-cli image fails on x86 #30126

@prachi-gaonkar

Description

@prachi-gaonkar

Describe the bug

Hi team

we are trying to build this docker file
https://github.com.mcas.ms/Azure/azure-cli/blob/azure-cli-2.65.0/scripts/release/debian/Dockerfile

but we are facing issues during build. We did below changes but still it gives errors.

  1. to resolve error at 'pip install wheel ' changed base image to ubuntu:22.04
  2. removed '&&' at line 31 to resolve syntax error.
  3. the build is failing at command "dpkg-buildpackage -us -uc" with below error
    dpkg-shlibdeps: error: cannot read debian/azure-cli/opt/az/lib/python3./lib-dynload/_ssl.cpython-3-*-linux-gnu.so: No such file or directory
    make[1]: Leaving directory '/azure-cli'
    make[1]: *** [debian/rules:21: override_dh_install] Error 2
    make: *** [debian/rules:8: binary] Error 2
    dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2

fyi we could locate same file at below 3 locations:
RUN find / -name "_ssl.cpython-3*-*-linux-gnu.so" 14.0s
=> => # /usr/lib/python3.10/lib-dynload/_ssl.cpython-310-x86_64-linux-gnu.so
=> => # /azure-cli/python_env/lib/python3.10/lib-dynload/_ssl.cpython-310-x86_64-linux-gnu.so
=> => # /azure-cli/build/lib.linux-x86_64-3.10/_ssl.cpython-310-x86_64-linux-gnu.so

  1. We have tried copying the above file to desired location but it fails with same error.
    Command to copy file: RUN mkdir -p debian/azure-cli/opt/az/lib/python3./lib-dynload/
    RUN cp /usr/lib/python3.10/lib-dynload/_ssl.cpython-310-x86_64-linux-gnu.so debian/azure-cli/opt/az/lib/python3.
    /lib- dynload/

please let us know what can be done here

Related command

Command used to build docker image.
docker build --target build-env -f ./scripts/release/debian/Dockerfile -t azure/azure-cli:ubuntu-builder .

Errors

Error:
dpkg-shlibdeps: error: cannot read debian/azure-cli/opt/az/lib/python3./lib-dynload/_ssl.cpython-3--linux-gnu.so: No such file or directory
. dpkg-shlibdeps: debug: Using symbols file /var/lib/dpkg/info/libc6:amd64.symbols for libm.so.6
. dpkg-shlibdeps: debug: Using symbols file /var/lib/dpkg/info/libc6:amd64.symbols for libc.so.6
. dpkg-shlibdeps: debug: >> Scanning debian/azure-cli/opt/az/lib/python3.
/lib-dynload/_ssl.cpython-3*-*-linux-gnu.so (for Depends field)
. make[1]: *** [debian/rules:21: override_dh_install] Error 2
. make[1]: Leaving directory '/azure-cli'
. make: *** [debian/rules:8: binary] Error 2
. dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2

Issue script & Debug output

As mentioned above

Expected behavior

Image should build successfully
https://github.com.mcas.ms/Azure/azure-cli/blob/azure-cli-2.65.0/scripts/release/debian/Dockerfile

Environment Summary

OS: ubuntu 22.04

Additional context

No response

Metadata

Metadata

Assignees

Labels

Azure CLI TeamThe command of the issue is owned by Azure CLI teamOKR CandidateThis label is used to track how many GitHub issues we have resolved for OKR purpose.Similar-Issuecustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions