# 安裝docker

## CentOS7 環境 :

透過管理員權限下達以下指令即可

```
sudo yum remove docker \
      docker-common \
        container-selinux \
          docker-selinux \
            docker-engine \
          docker-engine-selinux
sudo yum install -y yum-utils \
      device-mapper-persistent-data lvm2
sudo yum-config-manager \
      --add-repo \
        https://download.docker.com/linux/centos/docker-ce.repo
sudo yum-config-manager --enable docker-ce-edge 
#edge version
sudo yum makecache fast
sudo yum install -y docker-ce
# 啟動docker
sudo systemctl start docker
# 檢視版本
sudo docker --version
```

## Ubuntu 環境 :

透過管理員權限下達以下指令即可

```
sudo apt-get remove docker docker-engine -y
sudo apt-get remove docker.io -y
sudo apt-get install \
    linux-image-extra-$(uname -r) \
    linux-image-extra-virtual
sudo apt-get install \
  apt-transport-https \
  ca-certificates \
  curl \
  software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
  "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) \
  stable"
sudo apt-get update -y
sudo apt-get install docker-ce -y
sudo groupadd docker 
sudo usermod -aG docker $USER
# 啟動docker

sudo systemctl enable docker 
# 檢視版本
sudo docker --version
```

## Mac 環境 :

下載 docker desktop for mac

[載點](https://hub.docker.com/editions/community/docker-ce-desktop-mac/)

## Windows 環境 :

下載 docker desktop for mac

[載點](https://hub.docker.com/editions/community/docker-ce-desktop-windows/)
