Sunday, May 19, 2024

Cài đặt docker trên Ubuntu 24.04 (Series docker- Tập 1)

 Kiểm tra Ip đang có của máy unbuntu 24.024 

Ip addr

Mọi thứ ổn đúng ip mong muốn, ping internet thông thì chúng ta tiến hành thực hiện bước tiếp theo

Cài đặt openssh để connect vào docker làm việc thông may ssh trên máy windows

sudo apt-get install openssh-server

Cho phép port thông 22 của ssh thông qua firewall

               sudo ufw allow 22/tcp

Hoặc

   sudo ufw allow ssh

Kiểm tra trạng thái dịch vụ ssh server       
    sudo systemctl status sshd.service



Tham khảo từ link

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04

thiết lập các update cho package đang có

sudo apt update

Cài đặt các packages cần thiết để có thể cài đặt apt thông qua https

sudo apt install apt-transport-https ca-certificates curl software-properties-common

Thêm key GPG cho kho chứa docker trong máy tính của bạn.

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –

Add the Docker repository to APT sources:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"

Kiểm tra có thể cài đặt docker từ  mặc định ubuntu repo

    apt-cache policy docker-ce

cài đặt bảng docker community edition

    sudo apt install docker-ce

    sudo systemctl status docker

Nếu bạn không muốn gõ sudo phía trước các lệnh docker thì bạn  thêm user vào nhóm có quyền chạy Docker

Thay ${USER} = tên user bạn muốn add vào docker

sudo usermod -aG docker ${USER}

su - ${USER}

cuối cùng kiểm tra xem thông tin container đang có

    docker info



Như thế xong phần cài đặt docker trên Ubuntu 24.04.  Mọi người cứ làm theo hướng dẫn thì sẽ thành công. Mình làm biến chụp hình step by step. Chúc anh, em thành công .

No comments:

Post a Comment