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

บทความ

ทดลอง 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 อื่นๆ

ย้าย Docker Container ข้าม Cloud Provider

ย้าย Docker Container ข้าม Cloud Provider Posted on  02/12/2014   by  Anuchit Chalothorn ปัญหาเรื่องการย้าย Application ข้าม Cloud Provider เป็นปัญหาปกติที่ต้องหาทางแก้ไข ซึ่งแต่ละ Cloud Provider มีช่องทางในการบริการที่ต่างกัน เทคโนโลยีต่างกัน เครื่องมือที่ใช้งานก็ต่างกัน เรียกได้ว่าถ้าจะย้าย instance จะทำได้ยากมาก ครั้งนี้จะให้แนวคิดเรื่องการย้าย Container จาก Cloud Provider ค่ายหนึ่งไปยังอีกค่ายหนึ่งหรือจาก Local ไปยัง Cloud Provider ก็ได้ ซึ่งทำได้หลายวิธี จากภาพแนะนำการย้ายแบบง่ายๆ ผ่าน Docker อย่างเดียวไม่ได้ใช้เครื่องมือใดๆ เพิ่มเติม ถ้าจะให้สะดวกควรมี Orchestration Service อยู่ในแต่ละ Cloud Provider ด้วย ในเบื้องต้นทำความเข้าใจแบบง่ายๆ กันก่อน การทำ Migration ทำได้ 2 แบบ คือ Import / Export ไฟล์ Container ทั้งก้อนจาก Local ไปยัง Cloud วิธีนี้จะให้ความสะดวกมากกว่าแต่การสำรองข้อมูลและการย้ายไฟล์ Export จะช้าขึ้นอยู่กับความเร็วของเน็คเวิร์ก Push / Pull ให้ Commit Container State ปัจจุบันแล้ว push ขึ้น Docker Registry อาจจะเป็น Docker Hub (Private) หรือ P...