Skip to content

openssl command not found in Azure CLI 2.43.0 docker image #24836

Description

@jiasli

Symptom

The latest Azure CLI 2.43.0 docker image doesn't contain openssl command anymore.

> docker run -it mcr.microsoft.com/azure-cli
0c12bf6c7b2f:/# openssl
bash: openssl: command not found

This causes failure if a user's workload relies on openssl command.

Root cause

According to Alpine Linux 3.17's release history:

https://alpinelinux.org/posts/Alpine-3.17.0-released.html

OpenSSL 3.0 is now the default OpenSSL version. OpenSSL 1.1 is available via the openssl1.1-compat package.

openssl package in alpine:3.17 is now OpenSSL 3.0:

> docker run -it alpine:3.17
# apk search openssl
...
openssl-3.0.7-r0

OpenSSL 3.0 is not compatible with cryptography 3.3.2 which Azure CLI currently uses. For compatibility with cryptography, we now installs openssl1.1-compat:

openssl1.1-compat installs /usr/bin/openssl1.1 command:

# apk add openssl1.1-compat
# apk info --contents openssl1.1-compat
openssl1.1-compat-1.1.1s-r0 contains:
usr/bin/openssl1.1
# command -v openssl1.1
/usr/bin/openssl1.1

Because openssl package is not installed anymore, /usr/bin/openssl command is not available.

For the released docker image, Azure CLI (az command) is the only tool that is guaranteed to work. The availability of other tools or packages are not guaranteed. If you rely on a certain tool or package such as openssl, you have to manually install it with apk add before using it.

However, it is still a good practice for us to explicitly mention such changes. For example:

Proposed solutions

  • Install openssl, either in the docker image by us or by your own workload. This will make openssl command available again, but this may introduce other breaking changes as openssl 3.0 may not be backward compatible with openssl 1.1, even though they share the same name.
  • Switch to using openssl1.1 in your workload, until you have fully tested openssl 3.0 works as expected with your workload.
  • Temporarily use Azure CLI 2.42.0 docker image until we add openssl in Azure CLI 2.44.0.
  • We make a symbol link for openssl that points to openssl1.1 in the docker image, but this is very difficult to maintain and introduces more inconsistency and complexity.

Additional information

#22864 unpinned the base image Alpine Linux version. Now I am more inclined not to do so, as Alpine Linux frequently introduces breaking changes. We should also declare the version update in our history notes if we update the underlying base image version. However, a side effect is that CVEs of the base image can't be fixed automatically and quickly, which is the original motivation for unpinning it.

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamInstallationquestionThe 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