for simple docker file basics [click me..]
docker build -t image_name -f dir/to/docker_file
use of tags xyz
docker build -t image_name:xyz -f dir/to/docker_file
the best way to run a docker container is with --init as it will create a proxy to the server so that ctrl+c can kill the process.
docker run --init docker-image-namealso if you are just playing with docker always use --rm
docker run --init --rm docker-image-nameuse --publish outer_port:inner_port instead of EXPOSE
docker run --init --rm --publish 3000:3000 --name my-container my-image-name-p is the shorthand for --publish
see example this [click me..]
use From base_image_name as stage_name in dockerfile say the stage name is first_stage
From base_image_name as stage_namein the satage where you want to copy something from fist_stage use
COPY --from:stage_name --chown=user_group:username /stage_contant_dir /destination_dirfor more see here.. [click me...]
- link [click me...]
put all the files and folders in the .dockerignore file to not to copy it in the image
see example [click here]
Notes and example link : [click me]
Notes and example link : [click me..]
Notes and example link : [click me]