keybase / keybase-issues

A single repo for managing publicly recognized issues with the keybase client, installer, and website.
902 stars 37 forks source link

Python GNUPG "sign+encrypt failed: Inappropriate ioctl for device" Within Docker Container #4038

Open TitanRob16 opened 3 years ago

TitanRob16 commented 3 years ago

I can encrypt files perfectly fine when specifying a passphrase, but for some reason when I don't specify a passphrase, python-gnupg returns with:

gpg: signing failed: Inappropriate ioctl for device

I use a docker container for encrypting and decrypting.

I came across this Github issue (https://github.com/keybase/keybase-issues/issues/2798), which suggests to run:

export GPG_TTY=$(tty)

I've added this to my Dockerfile, but I'm still running into the same issue:

RUN export GPG_TTY=$(tty)

I couldn't find anything related to --no-tty in the docs (https://gnupg.readthedocs.io/en/latest/).

Any help with this would be appreciated!

femi-anthony commented 2 years ago

You need to add this to your Dockerfile:

ENV GPG_TTY=<ttyvalue>

where ttyvalue is what is obtained when running tty in the container