docker-keybox
docker-keybox copied to clipboard
Using custom source with the Docker Container
Hi Gary,
I've made some changes to the keybox code that lays the groundwork for a rest API to allow adding of servers, etc. Would it be easy to use this code with your Docker image?
The chief thing you need to do is build a complete .tar.gz which has Jetty packed inside it, exactly like Sean Kavanagh provides on his releases page here: https://github.com/skavanagh/KeyBox/releases
I don't believe he has yet published scripts or the method to do that. However, I crafted one myself that works for me, and shared it with him here in this issue thread: https://github.com/skavanagh/KeyBox/issues/101
Take a look at that first. Once you can create such a release .tar.gz, then it is trivial to use that one instead in the docker image. Just let me know how it goes, and I can provide simple instructions here.
May be a silly question, but which directory in the tree does the script need to be placed into? using the root directory of the project (containing pom.xml) fails, and /src seems to not work properly as well.
Not silly at all. I was scratching my head for a while even looking at my own scripts, mainly because I've only done it once... back last September! But, fortunately I actually did it in a docker container I still have, so I snooped around.
First, you need to make sure you have Apache maven installed, and any prerequisites. Maven is used to compile and build the Keybox Jetty application. As I recall, I did not use a standard distribution install because something went wrong. Instead, I installed it from scratch using the instructions on the Apache site and added the bin directory to my path. I don't use Maven or Java regularly, so there may be a better way, but you're on your own there.
Then, it should be simple (don't quote me on that):
git clone [email protected]:garywiz/KeyBox.git
cd KeyBox
mkdir package
cd package
# PUT THE SCRIPT HERE, mine is called build_dist.sh
./build_dist.sh
# The dist subdirectory should contain the distribution tar.gz file.
This is not something I do reguarly, and it's not a very refined process. At some point, I'm hoping Sean publishes his mechanism for doing this (he may have already, but couldn't find it).
Also observe Sean's comments at the end of my original issue discussion. I don't think the extra items are needed for the Docker container, because I create SSL and other scripts myself inside the new container, but it's worth noting if you're trying to "do this right".
Let me know how it goes.
Hi Gary, little late of a reply here but got sidetracked with some other projects. Running your script works for everything except one step. When you
Add template files
cp -a ../$TARNAME/. $TARNAME/.
it throws an error
cp: cannot stat ‘../KeyBox-jetty/.’: No such file or directory
Now I haven't really looked at the script too aggressively so I'm hoping I can figure it out (done for the day) but figured you may know what that step does and if it's necessary/how it could be fixed.