Creating a Docker Image & Running a Container

  • Docker images are build using Dockerfile definitions
  • E.g. hello-world image:
    FROM scratch
    COPY hello /
    CMD ["/hello"]
  • Where 'scratch' is name:tag of base image, in this case most basic image 'scratch:latest'
  • 'COPY' command copies executable file 'hello' to the root of file system
  • 'CMD' is command executed when container is running
  • Official Elastic Search Dockerfile is not as simple
  • To run official image:
    sudo docker run -d -p 9201:9200 -e "" -e ""
  • -d: run in a detached mode
  • -e: define listener ip for API and for cluster communication
  • -p: map host port to container port

results matching ""

    No results matching ""