Decrypt with gpg from inside a docker container

I have an encrypted file with gpg that I want to decrypt from inside a docker container.
gpg is not found on the container, how would I add it.

  • Exhausted Virtual Memory Installing SyntaxNet Using Docker Toolbox
  • How to check that a local URL is reachable
  • docker-compose down default_network error
  • Logs of a docker container
  • Why the directory created after WORKDIR disappear
  • Docker Couchbase Failed to connect to 127.0.0.1 port 8091: Connection refused
  • pip cannot install websocket-server python packge
  • JCoCo Code Coverage inside Docker Image
  • Docker container apt-get install can't find package
  • Reach host with Docker Compose
  • Setting docker with nginx and php5
  • apt-get install -f does not resolve dependencies
  • One Solution collect form web for “Decrypt with gpg from inside a docker container”

    Depending on your base image (used by your container), you would need to add to your Dockerfile
    (or to make one, starting with FROM <the image used by your container>) with:

    RUN apt-get update && apt-get install gnupg
    

    (as in this docker-vault-init Dockerfile)

    Then check out “Adding GPG key inside docker container causes “no valid OpenPGP data found””.
    This could be needed:

    RUN apt-get install -y ca-certificates wget
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.