top | item 28582181

Push Docker image from specific sub-directory

3 points| summerborn | 4 years ago

We have a huge monorepo (built using NodeJS). We have application drivers with the name: Validator, Reader, etc. inside of the monorepo. Each of those application drivers are sub-directory. We also have a private Docker Hub account where the entire monorepo is pushed as Docker image. Is it possible to push each sub-directory as docker image and not as a whole? How do we go about with it. By the way, the source code is in Bitbucket.

6 comments

order

GreenBackBoogie|4 years ago

What would be your final purpose with this? Slim the image down? Hoping to have a better CI/CD strategy if split it in multiple images? Anyways, I have a hunch that this will be solved only by having an architectural revamp of the app, try to design it in such a way that it will work as multiple smaller services interacting together as a whole (micro-services).

Also, Docker Compose doesn't really help you with this. It only helps you with "syncing" the components of your app together, but since you don't have the components of it yet running as separate images / containers, it's pointless, at least at this time.

summerborn|4 years ago

Well, I hope to use each of those images from sub directory as a Kubernetes container.

01e8|4 years ago

Looks like you need the docker-compose.

summerborn|4 years ago

Does each of those drivers/sub-directory applications require their own Dockerfile first?