Enter in AWS
Install local curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install aws --version Running the official AWS CLI version 2 Docker image The official AWS CLI version 2 Docker image is hosted on DockerHub in the amazon/aws-clirepository. The first time you use the docker run command, the latest Docker image is downloaded to your computer. Each
Install local
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install aws --version
Running the official AWS CLI version 2 Docker image
The official AWS CLI version 2 Docker image is hosted on DockerHub in the amazon/aws-cli
repository. The first time you use the docker run
command, the latest Docker image is downloaded to your computer. Each subsequent use of the docker run
command runs from your local copy.
To run the AWS CLI version 2 Docker image, use the docker run
command.
$ docker run --rm -it amazon/aws-cli command
The command is how the command functions:
- The
docker run --rm --it amazon/aws-cli
is the equivalent to theaws
executable. Each time you run this command, Docker spins up a container of your downloadedamazon/aws-cli
image, and executes youraws
command. By default, the Docker image uses the latest version of the AWS CLI version 2.For example, to call theaws --version
command in Docker, you run the following.
-
$ docker run --rm -it amazon/aws-cli --version aws-cli/2.0.6 Python/3.7.3 Linux/4.9.184-linuxkit botocore/2.0.0dev10
- The
--rm
specifies to clean up the container after the command exits. - The
-it
specifies to open a pseudo-TTY withstdin
. This allows you to provide input to the AWS CLI version 2 while it’s running in a container, for example, by using theaws configure
andaws help
commands.
For more information about thedocker run
command, see the Docker reference guide