-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
azure-cli Docker image doesn't support db-up #17027
Comments
As a consequence this issue prevents |
@fengzhou-msft Was there any issue for docker image? |
hi @fengzhou-msft could you pls have a look? |
You need to install |
That's a usable workaround. Though annoying since I'm not using PostgreSQL in all my projects. Hazarding a guess the quickest full fix, beyond that quick workaround, would be either to include that package in the base image, or modify the db_up extension so that it doesn't require the PostgreSQL package at install time. That last is harder but would result in a smaller image when not using PostgreSQL. |
Running Pulled the latest version of the docker image docker pull mcr.microsoft.com/azure-cli Ran the image docker run -it --name azure-cli mcr.microsoft.com/azure-cli Installed postgresql-dev and installed the db-up extension apk add postgresql-dev
az extension add --name db-up --debug It still fails during the compilation of
|
I got rid of most build errors when I run the command below. Now apk add --no-cache --virtual .build-deps \
gcc \
python3-dev \
musl-dev \
postgresql-dev \
freetds-dev \
freetds \
&& pip install --no-cache-dir psycopg2==2.9.1 pymssql==2.2.2 \
&& apk del --no-cache .build-deps However it still fails:
As you can see we get the error I tried to resolve this by installin gcompat to be able to run libc on alpine as described here. However this still doesn't work. I guess my only option now is to build my own debian based docker image, since the root cause seems to be that the azure-cli image is based on alpine which doesn't play nicely with libc. Another argument for: #20964 |
For anyone finding this, here's the dockerfile I made as a workaround: FROM debian:buster
RUN apt-get update -y \
&& apt-get install -y curl \
&& curl -sL https://aka.ms/InstallAzureCLIDeb | bash In this docker you can install
|
Hi @jeroenvervaeke is this solution also applicable for Mac OSX? az extension add --name db-up az_command_data_logger: exit code: 1 ➜ ✗ az extension add --name db-up az version |
@scheung38 you should run the command This is step by step how you can use my workaround:
FROM debian:buster
RUN apt-get update -y \
&& apt-get install -y curl \
&& curl -sL https://aka.ms/InstallAzureCLIDeb | bash
If you want to continue working in the same docker you can just run the command in step 6 to re-attach, no need to make a new container all the time. I hope this cleared things up regarding my workaround. Regarding the issue you're having, I don't think it's related to this issue at all, maybe it's better to create a new here |
Describe the bug
Command Name
az extension add
Errors:
Attached is the log produced by using the
--debug
flag: log.txtTo Reproduce:
mcr.microsoft.com/azure-cli
image.az extension add --name db_up
Expected Behavior
The extension installs without error.
Environment Summary
Additional Context
The text was updated successfully, but these errors were encountered: