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.

  • Docker: build with different results compared to manual step-by-step build
  • git clone can not reach host inside docker container
  • How to restart container using container-id?
  • What is the correct way to run an nginx docker container in OpenShift?
  • How to pass parameters while creating consul client agent inside a Docker container?
  • sha256sum error while building nvidia-docker on ppc64le
  • netcat udp connection hang inside UDP conatiner
  • Openshift doesn't copy docker container files to persistence volume
  • How to use RUN clone git in dockerfile
  • Access service running in docker container from inside another docker container
  • Specify docker engine version with docker machine
  • How do I deploy to a remote docker host on windows server 2016?
  • 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.