├── README.md ├── compose ├── Dockerfile2 ├── README.md ├── docker-compose.yaml ├── docker-compose2.yaml ├── go.mod └── test.go ├── consoleapp ├── Dockerfile ├── README.md └── hello.sh ├── labs └── README.md ├── networking └── README.md ├── phpwebsite ├── Dockerfile ├── README.md ├── config.php ├── content │ ├── 404.php │ ├── about-us.php │ ├── contact.php │ ├── home.php │ └── products.php ├── functions.php ├── index.php ├── screenshots │ └── website_homepage.png └── template │ └── template.php ├── screenshots ├── Explicitly_Epdate_Tag.png ├── another_tag_push.png ├── create_repo.png ├── docker-build-image.png ├── docker-compose-up-d.png ├── docker-compose-version-check.png ├── docker-run-my-first-container.png ├── docker_default_network_driver.png ├── docker_hub_beta_push.png ├── docker_inspect.png ├── docker_login.png ├── docker_network_driver.png ├── docker_push.png ├── docker_repo.png ├── docker_run_new_container_interactive_mode.png ├── dockerfile_good_practice.png ├── dockerhub_navigation.png ├── explicit_tagging.png ├── hub_docker.png ├── image_build_history.png ├── image_remove.png ├── labs │ ├── dashboard.png │ ├── docker_pull.png │ ├── docker_run_container.png │ ├── labs_playground.png │ ├── pwd.png │ └── webapp_home.png ├── mywebapp_running.png ├── ping-container.png ├── remove_tag.png ├── repo_confirmation.png ├── tag_when_build.png ├── tagging_for_push.png └── webmail.png └── webapp ├── .dockerignore ├── .gitignore ├── Dockerfile ├── README.md ├── go.mod ├── test.go ├── wo └── wordpress ├── README.md └── wordpress-compose.yaml /README.md: -------------------------------------------------------------------------------- 1 | # Docker App Development & Command Practice 2 | 3 | ## What is Docker? 4 | > A platform for building,running and shipping applications. in a consistent manner so if your application works on your development machine it can run and function the same way on other machine. 5 | 6 | > **Container:** An isolated environment for running an application. 7 | 8 | > **Container states** – A container can be in one of four states: created,running, paused, exited, restarting. 9 | 10 | ## Docker Image: 11 | > Docker images are The blueprints of our application which form the basis of containers. We use docker pull command to download an image. 12 | 13 | * A standalone, executable package that can be run in a container. 14 | 15 | * A Docker image is a binary that includes all of the requirements for running a single Docker container, as well as metadata describing its needs and capabilities. 16 | 17 | * An image includes everything that is needed to run an application, including the application's executable code, any software on which the application depends, and any required configuration settings. You can build your own images (using a Dockerfile) or use images that have been built by others and then made available in a registry (such as Docker Hub). 18 | 19 | * To build an image from a Dockerfile you use the docker build command. 20 | 21 | * To run an image in a container you use the docker run command. 22 | 23 | 24 | > **Containers** - Created from Docker images and run the actual application. After downloading the image We create a container using docker run command. A list of running containers can be seen using the docker ps command. 25 | 26 | ## Dockerfile: 27 | > A text document containing the commands to build a Docker image.\ 28 | > To build an image from a Dockerfile you use the docker build command. 29 | 30 | ### Example Dockerfile 31 | ``` 32 | #comments 33 | FROM golang:alpine 34 | ENV GO111MODULE=on 35 | ENV BG_COLOR=skyblue 36 | WORKDIR /opt/webapp 37 | COPY . . 38 | RUN go build 39 | RUN go install -v ./... 40 | EXPOSE 8180 41 | CMD ["dockerapp"] 42 | ``` 43 | 44 | ### We use docker build command to create container from above dockerfile 45 | > Syntax: docker build