{"id":1062,"date":"2021-05-14T11:00:42","date_gmt":"2021-05-14T03:00:42","guid":{"rendered":"https:\/\/www.linuxdevops.cn\/?p=1062"},"modified":"2022-06-24T10:21:42","modified_gmt":"2022-06-24T02:21:42","slug":"installing-docker-and-docker-compose-in-centos7","status":"publish","type":"post","link":"https:\/\/www.linuxdevops.cn\/2021\/05\/installing-docker-and-docker-compose-in-centos7\/","title":{"rendered":"Centos7 \u5b89\u88c5docker \u548cdocker-compose"},"content":{"rendered":"
## docker\u963f\u91cc\u4e91\u6e90\n\ncurl -o \/etc\/yum.repos.d\/docker-ce.repo https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/centos\/docker-ce.repo\n\n### Install required packages for docker.\n\nyum install -y device-mapper-persistent-data lvm2\nyum install -y docker-ce-19.03.8\n\n## Create \/etc\/docker directory.\n\nmkdir \/etc\/docker\n\n# Setup daemon.\n\ncat > \/etc\/docker\/daemon.json <<EOF\n{\n "registry-mirrors": ["https:\/\/lqetgo1f.mirror.aliyuncs.com","https:\/\/docker.mirrors.ustc.edu.cn\/"]\n}\nEOF\n\nmkdir -p \/etc\/systemd\/system\/docker.service.d\n\n# Restart Docker\n\nsystemctl daemon-reload\nsystemctl restart docker\nsystemctl enable docker\n\n## \u5b89\u88c5docker-compose\n\nsudo curl -L "https:\/\/github.com\/docker\/compose\/releases\/download\/1.29.1\/docker-compose-$(uname -s)-$(uname -m)" -o \/usr\/bin\/docker-compose\nsudo chmod +x \/usr\/bin\/docker-compose\ndocker-compose --version<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"## docker\u963f\u91cc\u4e91\u6e90 curl -o \/etc\/yum.repos.d\/docker-ce.repo h<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,17],"tags":[],"yoast_head":"\n
Centos7 \u5b89\u88c5docker \u548cdocker-compose - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n