ข้ามไปที่เนื้อหาหลัก

บทความ

script install docker AlmaLinux / Rocky Linux 8 System

 AlmaLinux / Rocky Linux 8 System Start the installation by updating AlmaLinux / Rocky Linux 8 system OS packages to the latest versions. sudo dnf -y update sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo : sudo dnf install docker-ce docker-ce-cli containerd.io docker-compose-plugin sudo systemctl enable --now docker sudo usermod -aG docker $USER newgrp docker Confirm if you’re able to run any docker commands without sudo: $ docker --version Docker version 20.10.17, build 100c701

ทดลอง pull image จาก GitLab

ทดลอง pull image จาก GitLab ลบ image เก่าโดยการพิมพ์  $ docker rmi registry.gitlab.com/blacksourcez/gitlab-registry-demo ทำการ pull โดยคำสั่ง  $ docker pull registry.gitlab.com/blacksourcez/gitlab-registry-demo ลอง run container โดยใช้คำสั่ง  $ docker run -p 80:80 registry.gitlab.com/blacksourcez/gitlab-registry-demo เข้า url  http://0.0.0.0:80/  จะพบข้อความ “Hello, World!”   https://medium.com/ayuth/%E0%B9%80%E0%B8%81%E0%B9%87%E0%B8%9A-container-image-%E0%B9%83%E0%B8%99%E0%B9%81%E0%B8%95%E0%B9%88%E0%B8%A5%E0%B8%B0%E0%B9%82%E0%B8%9B%E0%B8%A3%E0%B9%80%E0%B8%88%E0%B8%84%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-gitlab-google-amazon-elastic-container-registry-%E0%B9%81%E0%B8%A5%E0%B8%B0-d94c7cd2e54a

git hub to git lab

Switching remote URLs from SSH to HTTPS Open  Terminal . Change the current working directory to your local project. List your existing remotes in order to get the name of the remote you want to change. git remote -v origin git@ hostname : USERNAME/REPOSITORY .git (fetch) origin git@ hostname : USERNAME/REPOSITORY .git (push) Change your remote's URL from SSH to HTTPS with the  git remote set-url  command. git remote set-url origin https:// hostname / USERNAME / REPOSITORY .git Verify that the remote URL has changed. git remote -v # Verify new remote URL origin https:// hostname / USERNAME/REPOSITORY .git (fetch) origin https:// hostname / USERNAME/REPOSITORY .git (push)

Docker เปลียน containerไปเป็น image

https://github.com/limweb/testdockerfileenv/blob/master/docker-entrypoint.sh เราไม่จำเป็นต้องสร้าง image จาก dokcer file เสมอไปครับ วันนี้มีคำสั่งมาแนะนำ  docker commit  containerid  tag/name:latest เป็น คือครั้งแรกเราสร้าง container จาก image มาแล้ว  เวลาใช้งานไปเกิดปัญหาต่าง ๆ ต้องเข้าไปติดตั้งเพิ่ม ทำให้ image ต่างจากเดิมไปมาก สมมติว่า เราจำเป็นต้อง clone รูปแบบ container นี้มาใช้งาน ปัญหาเกิดละถ้าใช้ image ตั้งต้น ก็ต้องนึกให้ดีนะว่า ติดตั้งเพิ่มอะไรไปบ้าง เอานี้ไม่ต้องทำแล้ว ใช้คำสั่ง มันจะสร้าง image ให้อีกตัว และเราก็สามารถ push ขึ้น docker hub ได้ด้วย ตามปกติ เวลาใช้ตัวใหม่ก็แค่ กำหนดเป็น image ใหม่ที่สร้าง Jenkins, Travis, Bitbucket, Gitlab, AWS อื่นๆ