Properly Creating a Docker Container


Recommended Posts

So I've got a grasp on the general idea of docker containers, and was working on creating one. I'm pretty sure that the way I'm going about it isn't really the right way.

 

I'm trying to create a docker container for the protonmail bridge, since i wasn't able to find one that'd been updated recently.

 

What I'd done so far was create a docker from phusion/baseimage, and modify it to where I wanted it. I'd downloaded the .deb file for the bridge and installed all the packages it required, though i ended up using the command apt --fix-broken install, which I feel was incorrect to what I wanted. I got to the point where I was just working on configuring the bridge, but am thinking that I'm doing this incorrectly, since there's a ton of configuration.

 

What would be the approach to create a docker image without needing to do all this configuration inside the container itself? I'm pretty sure I shouldn't download the .deb file directly inside the container, but am not really sure how to make more complicated docker containers.

 

Link to comment

That pretty much how it's done. Its very tedious and time consuming getting things just right. But once you're done and pushed those changes as an image, then anyone else can use it too.

 

Docker has tutorials on creating images, such as using the dockerfile and docker commands and then pushing/committing the resulting image to its hub.

 

For configuration ... In this situation you need to work out how to externalize the changes to a single file. If not a single file then maybe an entire directory. Deal with that with volumn mappings to externalize it.

 

If that's not possible then you need to make your own script or program system to process from a single file or maybe docker environment variables/parameters. Then on every docker startup, your image processes the file and makes adjustments as needed inside the image.

 

 

Link to comment
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.