Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bypassing the --password-stdin warning (docker)

Another day, another problem with docker. I have a Windows server 2019, docker version 18.09.03 and I want to get my images to ECR.

For certain reasons, I can't have the warning docker : WARNING! Your password will be stored unencrypted My deployment tool considers it as an error and thus, doesn't deploy. I have therefore been looking how to use --password-stdin in the "correct" manner. Which isn't going very well.

Here is the Powershell script I am using right now.

#First step to create the file
aws ecr get-login --no-include-email | Out-File -FilePath FILEPATH 
#Second step to filter the file and just get the password.
-split @(Get-Content -Path FILEPATH) |Select-Object -Index 5 | Out-File -FilePath FILEPATH

#Get authorized but stdin warning?? 
cat FILEPATH | docker login -u AWS --password-stdin https://NUMBER.dkr.ecr.eu-west-1.amazonaws.com

I am passing the password into a file then stdin from it, it works but it returns the warning.

I have tried that comment too (https://github.com/aws/aws-cli/issues/2875#issuecomment-433565983) but it doesn't accept the flags neither. I do

aws ecr get-login --no-include-email --region eu-west-1 --password-stdin and Unknown options: --password-stdin
aws ecr get-login --region us-east-1 --print-password-only
--print-password-only is unknows as well)

I am FULLY starting to get annoyed and frustrated by now. Any help would be appreciated, thanks!

like image 520
shrimpy Avatar asked Oct 19 '25 22:10

shrimpy


1 Answers

Use --password-stdin by providing the password via stdin like so:

echo <my_password> | docker login -u <username> --password-stdin

Or, if fetching the password from a file, like so:

cat <my_file> | docker login -u <username> --password-stdin
like image 121
Sebastian Avatar answered Oct 24 '25 09:10

Sebastian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!