I was under assumption that run container through base image and install all dependencies w.r.t to application and once all is tweaked then prepare Dockerfile from that, as you confirmed it’s not possible hence what do you suggest for below.
Best way is for creating container is through Dockerfile? or else run container from base image and install all dependencies w.r.t to application and then prepare Dockerfile based on command executed inside container or else
as I mentioned in my initial post follow approach i.e., run container from base image then tweak all parameter w.r.t app then commit, tag, save through docker save in .tar file and use that .tar file to run container in other machine.
the best way for creating IMAGES is though a Dockerfile, yes, because then you have a recipe you can change if something needs updating, or you’re deploying a new version of your app, just re-run the dockerfile with the new version and then you only have the necessary componenets in your image, without any bloat.
and the proccess of creating a dockerfile is very straight-forward, once you know the syntax its very easy.
once you then have build your image, push it to a repo like docker hub and let your users pull it that way
Thanks, let me check over this. Also just to cross check if I needs to link multi-container as all are dependent to each other for running application then I need to use docker-compose? or else any other mechanism is there.
Yes, unless you have more complex orchestration needs (in which case I would recommend K8s) then docker-compose is suitable for multi-container applications. Don’t use the links construct though, that has been deprecated for a while. If you have dependencies between compose services you can use depends_on which will ensure that a dependent service is running before launching the one that depends on it (its basically a health check that impacts start-up order). In terms of inter container communication, that is enabled via networking. You can either declare an explicit external network or use the implicit default networking enabled by default (depends what n/w characteristics you need).
COPY command in dockerbuild file is copying content inside folder from host to container, need to copy whole folder, below is extract from docker file.
COPY folder1 /usr/local/lib64/