Skip to content

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

Closed
@lfir

Description

@lfir

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.

Activity

added
questionUsability question, not directly related to an error with the image
on Nov 12, 2018
wglambert

wglambert commented on Nov 12, 2018

@wglambert

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

wglambert commented on Nov 14, 2018

@wglambert

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.

added a commit that references this issue on Nov 28, 2018
added a commit that references this issue on Nov 30, 2018
added a commit that references this issue on Dec 6, 2018
added a commit that references this issue on Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUsability question, not directly related to an error with the image

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      build fails due to gpg: cannot open '/dev/tty' · Issue #526 · docker-library/postgres