Jerry's WIKIJerry's WIKI
Overview
  • ๐Ÿž Web
  • ๐Ÿ“ Components
  • ๐Ÿ’ก Skills
  • ๐ŸŽฑ Specification
  • ๐Ÿ–ฅ Workflows
  • ๐Ÿ›  Tools
  • ๐ŸŒ๏ธ Linux
  • ๐Ÿ“ฆ Container
  • โ™จ๏ธ Language
Coffee
  • ็ฎ€ไฝ“ไธญๆ–‡
  • English
GitHub
Overview
  • ๐Ÿž Web
  • ๐Ÿ“ Components
  • ๐Ÿ’ก Skills
  • ๐ŸŽฑ Specification
  • ๐Ÿ–ฅ Workflows
  • ๐Ÿ›  Tools
  • ๐ŸŒ๏ธ Linux
  • ๐Ÿ“ฆ Container
  • โ™จ๏ธ Language
Coffee
  • ็ฎ€ไฝ“ไธญๆ–‡
  • English
GitHub
  • ๐Ÿณ Docker

    • Basic
    • CI/CD
    • Volume
    • Network
    • Commands
  • ๐ŸŽ› Docker compose
  • ๐Ÿ•ธ Docker swarm
  • ๐Ÿ™ K8s

CI/CD

็›ฎๅฝ•

  • Build Workflow File
  • Alibaba Cloud Image Management Trigger

Main Process

  1. Local coding.
  2. Push code. (push remote repository)
  3. Build image. (github build image)
  4. Push image. (github push image to target image repository)
  5. Server pulls image.
  6. Container restart.

Build Workflow File

# Directory structure
.github
	|- workflows
		|- main.yml
app
Dockerfile

main.yml

name: Build and Publish Docker
on: [push]
jobs: 
  build:
	runs-on: ubuntu-latest
  	name: Build image job
	steps:
  	  - name: Checkout master
      uses: actions/checkout@master
      - name: Build and publish image
      # ่ฟ™้‡Œ็š„ๅทฅๅ…ทๆ˜ฏActionsๅนฟๅœบๆŸฅๆ‰พไฝฟ็”จ็š„,ๅฆ‚ๆžœไฝ ๆƒณๆ›ดๆข,ๅœจๅนฟๅœบๆœ็ดขๅณๅฏ
      # https://github.com/marketplace/actions
      uses: ilteoood/docker_buildx@master
      with:
    	repository: namespace-image/image-name # ๅ‘ฝๅ็ฉบ้—ด/้•œๅƒๅ็งฐ
        registry: registry.cn-shenzhen.aliyuncs.com # ไป“ๅบ“ๅœฐๅ€
        username: "xxx" # ไป“ๅบ“็”จๆˆท
        password: "xxx" # ไป“ๅบ“ๅฏ†็ 
        auto_tag: true
        
# Here are some recommended Action tools for building images:
# https://github.com/marketplace/actions/customizable-docker-buildx
# https://github.com/marketplace/actions/push-to-registry
# https://github.com/marketplace/actions/publish-docker-action

Alibaba Cloud Image Management Trigger

Use Alibaba Cloud trigger to manage image update actions.

ใ€Tipใ€‘

  1. You can implement a web server to receive Alibaba Cloud's webhook and then actively pull the updated image.
  2. The watchTower container can also monitor whether all containers' images are up-to-date, and if so, it will pull updates.
Edit this page
Update At:
Contributor: ็”ฐๆœๅธ†
Prev
Docker
Next
Volume