Read this post if you want to solve the ‘Cannot autolaunch D-Bus without X11 $DISPLAY’ error when attempting to login to AWSECR and Docker. This error occurs after you use the AWSECRget-login-password command.
Here is an example of the error:
Error saving credentials: error storing credentials - err: exit status 1, out:
Cannot autolaunch D-Bus without X11 $DISPLAY
In addition, you can this error after using the following command:
aws ecr get-login-password | docker login --username AWS --password-stdin 123example.dkr.ecr.ap-southeast-2.amazonaws.com/.../....
The expected result should be the normal docker login prompt which says:
What is AWS ECR get-login-password?
The AWS ECR get-login-password command retrieves and prints a password that can be used to authenticate to any Amazon ECR registry.
You must ensure that your IAM credential has access to do this before using it.
Also, note that the password is only valid for 12 hours after running the AWS ECR get-login-password command.
What is D-Bus and X11 ?
D-BUS is an interprocess communication system allowing applications to talk to one another.
X11 is a network protocol designed to enable remote graphical access through an SSH client.
The error can be solved when you run the following command:
apt install gnupg2 pass
This command will install the x11-common as well as the libice6, libsm6, libxmu6, libxt6, xclip and some additional gnupg2 libraries.
You should now have solved the ‘Cannot autolaunch D-Bus without X11 $DISPLAY’ error!