{"id":17952562,"url":"https://github.com/electron0zero/docker-intro","last_synced_at":"2025-04-03T16:24:29.550Z","repository":{"id":78755841,"uuid":"89341446","full_name":"electron0zero/docker-intro","owner":"electron0zero","description":"Playing around with docker","archived":false,"fork":false,"pushed_at":"2017-04-26T04:23:48.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T05:14:36.449Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/electron0zero.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-25T09:18:23.000Z","updated_at":"2017-04-25T09:19:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"3a0bfd37-98d4-4ec8-b250-39086407b705","html_url":"https://github.com/electron0zero/docker-intro","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electron0zero%2Fdocker-intro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electron0zero%2Fdocker-intro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electron0zero%2Fdocker-intro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electron0zero%2Fdocker-intro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/electron0zero","download_url":"https://codeload.github.com/electron0zero/docker-intro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247035288,"owners_count":20872761,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-29T09:58:12.029Z","updated_at":"2025-04-03T16:24:29.511Z","avatar_url":"https://github.com/electron0zero.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Intro\nThis repo have files for [Docker Get Started](https://docs.docker.com/get-started/).\n\nVisit [https://docs.docker.com/get-started/](https://docs.docker.com/get-started/) to get an idea if you don't know about docker\n\nDocker Image of this tutorial is available at Docker Hub \\\n[electron0zero/docker-intro](https://hub.docker.com/r/electron0zero/docker-intro/)\n\n## Few gotchas/ Things to keep in mind \n\n-  On Windows when you use docker using [docker-toolbox](https://www.docker.com/products/docker-toolbox), it runs it on a VirtualBox VM, Which results in ip of VM as address on which you listen, not on localhost.\n\n-  Use [Kitematic](https://kitematic.com/) to figure out this IP\n\n- If you are deploying real applications from windows,Then do not ignore warnings about permission and **make sure you have some mechanism to set appropriate permissions**\n\n*Here is Warning Message*\n\n\u003e SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.\n\n\n## Basic Commands\n\n**Command:** `docker version`\n\n**Output:**\n```\nClient:\n Version:      17.03.1-ce\n API version:  1.27\n Go version:   go1.7.5\n Git commit:   c6d412e\n Built:        Tue Mar 28 00:40:02 2017\n OS/Arch:      windows/amd64\n\nServer:\n Version:      17.04.0-ce\n API version:  1.28 (minimum version 1.12)\n Go version:   go1.7.5\n Git commit:   4845c56\n Built:        Wed Apr  5 18:45:47 2017\n OS/Arch:      linux/amd64\n Experimental: false\n```\n\n**Explanation:** Self explained imo\n\n---\n\n**Command:** `docker build -t docker-intro .`\n\n**Output:** output of executing Dockerfile and info about image\n\n**Explanation:** Builds image named `docker-intro` from `.` (current dir) \\\n[*assuming it have a Dockerfile in it**]\n\n---\n\n**Command:** `docker images`\n\n**Output:**\n```\nREPOSITORY          TAG                 IMAGE ID            CREATED             SIZE\ndocker-intro        latest              58274ed93000        4 minutes ago       194 MB\npython              2.7-slim            4a323b466a5a        3 hours ago         182 MB\n```\n\n**Explanation:** list docker images\n\n---\n\n**Command:** `docker run -p 4000:80 docker-intro`\n\n**Output:**\n```\n * Running on http://0.0.0.0:80/ (Press CTRL+C to quit)\n```\n*This output is from app, running in container.\\\nNot local system so will not be available that IP, It will be available on mapped port on VM's IP*\n\n- Use [Kitematic](https://kitematic.com/) to figure out ip on which you can access it.\n\n**Explanation:** run docker image `docker-intro` and `-p` flag is used port mapping, here port `4000` of system running docker(host) is mapped to port `80` of container.\n\n---\n\n**Command:** `docker run -d -p 4000:80 docker-intro`\n\n**Output:**\n```\n1b7d07adb936265a857da1b318e82b29e1bd15ef3f874239f7384948368f5829\n```\n\n**Explanation:** run in detached mode\n\n\u003eif you have issue saying `failed: port is already allocated`.\n\u003e It means you have an container running on that port, you can resolve it by killing/stopping that running container or changing it to a free port\n\n*use `docker stop \u003ccontainer-id\u003e`, container id can be found by running `docker ps -a`*\n\nSample Output of `docker ps -a`\n```\nCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                       PORTS                  NAMES\n1b7d07adb936        docker-intro        \"python app.py\"     2 minutes ago       Up 2 minutes                 0.0.0.0:4000-\u003e80/tcp   kind_dijkstra\n24146a2050a1        docker-intro        \"python app.py\"     4 minutes ago       Created                                             unruffled_varahamihira\n432528f53e40        docker-intro        \"python app.py\"     9 minutes ago       Exited (137) 3 minutes ago                          kind_haibt\n```\n\n\n### You can use [Docker Hub](http://hub.docker.com/) to share you images, it is like github for docker images.\n*I am not going into this, it is fully described in docker docs*\n\n### Final Thought \nDocker has more stuff then i described, it is just the gist of it. \\\nSee multi-part [getting-started guide](https://docs.docker.com/get-started/) to learn more","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felectron0zero%2Fdocker-intro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felectron0zero%2Fdocker-intro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felectron0zero%2Fdocker-intro/lists"}