Skip to content

build fails due to gpg: cannot open '/dev/tty' #526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lfir opened this issue Nov 12, 2018 · 2 comments
Closed

build fails due to gpg: cannot open '/dev/tty' #526

lfir opened this issue Nov 12, 2018 · 2 comments
Labels
question Usability question, not directly related to an error with the image

Comments

@lfir
Copy link

lfir commented Nov 12, 2018

Using version 11 (debian), when attempting to build the image I received the following error:
gpg: cannot open '/dev/tty': No such device or address
and the process was aborted.
I could solve it by passing the option --no-tty to the gpg command invocations on lines 31 and 67 of the Dockerfile.
Regards.

@wglambert wglambert added the question Usability question, not directly related to an error with the image label Nov 12, 2018
@wglambert
Copy link

This is likely an issue with your local environment, It builds fine for us https://travis-ci.org/docker-library/postgres/builds/452492635

This is the only relevant search result for your specific error https://stackoverflow.com/questions/52900636/gpg-command-works-in-shell-but-not-in-go-exec-command
It's possibly related to docker-library/official-images#4252

I recommend using the images we officially build/publish; for further assistance debugging your local environment the best I can recommend is trying the Docker Community Forums, the Docker Community Slack, or Stack Overflow.

@wglambert
Copy link

So this is an issue with a recent gpg update and we are encountering it, we filed a bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=913614#27

The bug appears to be due to the fix for https://bugs.debian.org/906545
-- where we applied cleaning to keys being imported.

That testing didn't try out all the variants without having access to a tty.

And we've opened a PR on it #527

From the comment in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=913614#27

PS i do encourage everyone who is automating the use of gpg to use
--batch everywhere, as this forces GnuPG into a mode that is expected to
be used for automation (its "API", for lack of a better term, as opposed
to its "UI", which is its normal non-batch mode). And, FWIW, i agree
with Tianon that GnuPG should simply assume --batch if no tty exists,
but that's not the kind of change i can fit into debian stable, i think.

jeancochrane pushed a commit to azavea/docker-django that referenced this issue Nov 28, 2018
A recent gpg update causes gpg to fail when run in an environment
without a tty
(https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=913614#27). To
mitigate this issue, run GPG in --batch mode as recommended here:
docker-library/postgres#526 (comment)
tst-mbiancalana added a commit to tst-mbiancalana/jenkins-docker that referenced this issue Nov 30, 2018
Recent changes to gpg caused different interaction with the TTY. This
causes issues when run in a Dockerfile. See also
docker-library/postgres#526

The datafile target of the `gpg --verify` call was missing as well.
nghiant2710 added a commit to balena-io/contracts that referenced this issue Dec 6, 2018
A recent gpg update causes gpg to fail when run in an environment
without a tty (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=913614#27). To mitigate this issue on Debian images, run gpg in --batch mode as recommended (docker-library/postgres#526 (comment))

Change-type: patch
Signed-off-by: Trong Nghia Nguyen <nghiant2710@gmail.com>
sweoggy added a commit to debricked/docker-image-php-xdebug that referenced this issue Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Projects
None yet
Development

No branches or pull requests

2 participants