Sign inSign up

joostdecock/keytool

By joostdecock

•Updated almost 7 years ago

A dockerized version of the Java keytool binary

Image
0

10K+

joostdecock/keytool repository overview

⁠keytool - A dockerized version of the Java keytool binary

⁠About keytool 🤔

The keytool command is used to manage a file-based database (a so-called keystore) of cryptographic keys, X.509 certificate chains, and trusted certificates. It is included in the Java distribution.

This keytool is a Dockerized version of the keytool binary⁠.

It is intended as a drop-in replacement for when you need to run keytool, but don't have Java available on your system.

⁠Usage 🔧

The joostdecock/keytool⁠ container image is a drop-in replacement for the keytool command. You can run it as such:

sudo docker run -it --rm joostdecock/keytool

For keytool to be able to read/write to a keystore file on the host system, you need to mount a volume.

For example, to mount the /etc/keystore folder, run this command:

sudo docker run -it --rm -v /etc/keystore:/etc/keystore joostdecock/keytool

Now, this dockerized keytool can access the files in the /etc/keystore folder on the host system.

To manipulate files in another directory, update the -v parameter accordingly.

⁠As a bash alias

For even more ease of use, configure a bash alias:

alias keytool="sudo docker run -it --rm -v /etc/keystore:/etc/keystore joostdecock/keytool"

Now the keytool command will spin up the container and run the binary, just as if it was installed locally. Because of the mounted volume, it will have access to the files in /etc/keystore.

In other words, this will just work:

keytool -keystore /etc/keystore/keystore.jks -list

⁠Where to get help 🤯

If you run into trouble, create an issue⁠

⁠License: MIT 🤓

© Joost De Cock⁠.
See the license file⁠ for details.

Tag summary

Content type

Image

Digest

Size

69.4 MB

Last updated

almost 7 years ago

docker pull joostdecock/keytool