Installing awscli on alpine Linux

Asked 2 years ago, Updated 2 years ago, 100 views

After installing awscli v2 on alpine Linux, the following is what happened:

Launch alpine

$docker run-it --rm alpine sh
/ # apk -- update add curl
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
(1/4) Installing ca-certificates (20191127-r1)
(2/4) Installing nghttp2-libs (1.40.0-r0)
(3/4) Installing libcurl (7.67.0-r0)
(4/4) Installing curl (7.67.0-r0)
Executing busybox-1.31.1 - r9.trigger
Executing ca-certificates-20191127-r1.trigger
OK: 7 MiBin 18 packages
/ # 

Installing AWS CLI Version 2 on Linux causes the error ./aws/install:line78:/aws/dist/aws:not found.

/# curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
/ # curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
  % Total %Received %Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
100 31.3M 100 31.3M 00 2047k 00:00:150:00:15 ----------2555k
/ # unzip-qawscliv2.zip
/ #./aws/install
./aws/install:line 78:/aws/dist/aws:not found
You can now run: /usr/local/bin/aws --version
/ # 

Doing the same with Ubuntu did not result in an error.

aws-cli

2022-09-30 18:17

2 Answers

The immediate answer is that alpine is not operational, and it seems to work if you add glibc.

Recent distributions of CentOS, Fedora, Ubuntu, Amazon Linux 1, and Amazon Linux 2 support AWS CLI version 2.

[v2]installing on docker image fails·Issue#4685·aws/aws-cli·GitHub

The binaries we publish won't work on docker images based on alpine because we're compiling the main glibc.


2022-09-30 18:17

The aws command was installed as follows, but it seemed to be due to a symbolic link for the relative path.

/#typeaws
aws is /usr/local/bin/aws
/ #ls-l/usr/local/bin/aws
lrwxrwxrwx1 root 37 May 2009:12/usr/local/bin/aws->/usr/local/aws-cli/v2/current/bin/aws
/ #ls-l/usr/local/aws-cli/v2/current/bin/aws
lrwxrwxrwx1 root root11 May 2009:12/usr/local/aws-cli/v2/current/bin/aws->../dist/aws
/ # 


2022-09-30 18:17

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.