Upgrade to Pro — share decks privately, control downloads, hide ads and more …

淺談開發與DevOps

LINE Developers Taiwan
October 17, 2023
290

 淺談開發與DevOps

Speaker: Eric Huang
Event: APCS camp 企業參訪

LINE Developers Taiwan

October 17, 2023
Tweet

More Decks by LINE Developers Taiwan

Transcript

  1. container簡介 • container可以視為⼀種輕量級的app,運⾏在OS之上 • 主流的container runtime (負責掌管container的manager,例如:Docker及 containerd)都⽀援MacOS, Linux及Windows •

    container底層是⽤Linux kernel的技術實現,做到環境隔離以及資源限制 • container可以預先安裝開發需要使⽤的的library, CLI等,也可以獨立運⾏app • 被⼤量使⽤在開發以及部署當中,為cloud native的基礎
  2. Dockerfile 範例 FROM python:3.11-buster WORKDIR /app COPY requirements.txt ./ RUN

    pip install --no-cache-dir -r requirements.txt --user COPY . /app CMD [ "python", "app.py" ]
  3. pipeline範例 steps: - name: Checkout uses: actions/checkout@v3 - name: Login

    to Harbor registry uses: docker/login-action@v2 with: registry: ${{ env.DOCKER_REGISTRY }} username: ${{ secrets.HARBOR_ACCOUNT }} password: ${{ secrets.HARBOR_PASSWORD }}
  4. pipeline範例(cont’d) - name: Docker meta id: meta uses: docker/metadata-action@v4 with:

    images: ${{ env.DOCKER_IMAGE_REPO }} - name: Build the Docker image uses: docker/build-push-action@v4 with: context: . file: Dockerfile push: true tags: | ${{ env.DOCKER_IMAGE_REPO }}/slackio-bot:${{ github.ref_name }}