{"id":18433155,"url":"https://github.com/ramesh-x/docker-setup","last_synced_at":"2025-04-14T02:41:10.862Z","repository":{"id":122414063,"uuid":"138990591","full_name":"Ramesh-X/Docker-Setup","owner":"Ramesh-X","description":"My personal docker setup document for Ubuntu 16.04","archived":false,"fork":false,"pushed_at":"2018-06-28T08:47:10.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-16T09:28:39.105Z","etag":null,"topics":["docker","docker-setup"],"latest_commit_sha":null,"homepage":null,"language":null,"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/Ramesh-X.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":"2018-06-28T08:38:07.000Z","updated_at":"2018-06-28T08:47:11.000Z","dependencies_parsed_at":"2024-08-03T11:30:08.204Z","dependency_job_id":null,"html_url":"https://github.com/Ramesh-X/Docker-Setup","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/Ramesh-X%2FDocker-Setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ramesh-X%2FDocker-Setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ramesh-X%2FDocker-Setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ramesh-X%2FDocker-Setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ramesh-X","download_url":"https://codeload.github.com/Ramesh-X/Docker-Setup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248812170,"owners_count":21165380,"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":["docker","docker-setup"],"created_at":"2024-11-06T05:32:07.404Z","updated_at":"2025-04-14T02:41:10.840Z","avatar_url":"https://github.com/Ramesh-X.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Setup docker environment Ubuntu 16.04\n\n## Installing\n```\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -\nsudo add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\"\nsudo apt-get update\n```\n\nRun `apt-cache policy docker-ce` and the output will look like\n```\ndocker-ce:\n  Installed: (none)\n  Candidate: 17.03.1~ce-0~ubuntu-xenial\n  Version table:\n     17.03.1~ce-0~ubuntu-xenial 500\n        500 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages\n     17.03.0~ce-0~ubuntu-xenial 500\n        500 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages\n```\n\nNotice that _docker_ is **not installed** and _download location_ is **download.docker.com**\nNow you can install docker\n```\nsudo apt-get install -y docker-ce\nsudo systemctl status docker\n```\n\u003cb\u003e * Make sure the docker is active and running before continue \u003c/b\u003e\n\n## Execute docker without `sudo`\n\n```\nsudo groupadd docker\nsudo gpasswd -a $USER docker\n```\nAnd type  `docker run hello-world` to make sure _docker_ running without `sudo`\n\n## Working with docker images\n`docker run hello-world`\nCheck whether docker run properly\n\n`docker search ubuntu`\nSearch docker images in **Docker Hub** which has `ubuntu` in their docker name.\n\n`docker pull ubuntu`\nDownload the _docker_ named _ubuntu_ to the local machine\n\n`docker run ubuntu`\nRun a docker container with the `ubuntu` docker image. If it is not pulled, the imaged will be pulled before run.\n\n`docker images`\nShow all docker images in the local machine\n\n## Running a Docker Container\n`docker run -it --name cotainer_name ubuntu`\nRun a docker container with interactive shell. The output will be like:\n`root@d9b100f2f636:/#`\n\nYou can now update the container and install something.\n```\napt-get update\napt-get install vim\n```\n\n## Commit Changes in a Container to a Docker Image\nFirst exit from the container with `exit` command. Then run the following.\n\n```\nexit\ndocker commit -m \"What did you do to the image\" -a \"Author Name\" container-id  repository/new_image_name\n```\n\nFor example:\n```\ndocker commit -m \"initial commit\" -a \"rameshpr\" d9b100f2f636 video-ml/rtpose\n```\n\nRun `docker images` and see the new image is there.\n\n\n## Listing Docker Containers\n\n`docker ps`\nList all active docker containers\n\n`docker ps -a`\nList all active and inactive docker containers\n\n`docker ps -l`\nView status of the latest container that you created\n\n`docker stop container-id`\nStop the active container with `container-id`. It can be found using `docker ps`\n\n## Run stopped docker container\n\n```\ndocker start 6ed287ad073b\ndocker attach 6ed287ad073b\n```\nThis start the stopped container and attach the terminal to it.\n\n## Remove docker containers\n\n`docker ps -a -f status=exited`\nView all exited docker containers\n\n`docker rm $(docker ps -a -f status=exited -q)`\nremove all exited docker containers\n\n## Copy files from Container\n`docker cp \u003ccontainerId\u003e:/file/path/within/container /host/path/target`\nHere the `containerId` can be the _name_ or the _ID_ of the container which is already started.\n\n**Guide on removing docker _images_, _containers_ or _volumes_** \nhttps://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes\n\n## Change docker image and container location\nhttps://sanenthusiast.com/change-default-image-container-location-docker/\n\nIf you want to change the size of the docker storage drive you can replace this line in `docker.conf` file.\n```\nExecStart=/usr/bin/dockerd --graph=\"/mnt/new_volume\" --storage-driver=devicemapper --storage-opt dm.basesize=20G\n```\nThen restart the docker.\n\n\n## More information\n1. https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04\n2. https://askubuntu.com/a/477554/568872\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framesh-x%2Fdocker-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framesh-x%2Fdocker-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framesh-x%2Fdocker-setup/lists"}