etherpad-lite icon indicating copy to clipboard operation
etherpad-lite copied to clipboard

Docker image build fails with ETHERPAD_PLUGINS in GitHub Actions workflow

Open lucaguindani opened this issue 2 years ago • 1 comments

Describe the bug Docker image build fails in a GitHub Actions workflow if the ETHERPAD_PLUGINS build-args is set. If I remove this specific arg the docker image is built & pushed successfully.

To Reproduce

  1. Run the following gha workflow file
name: docker
on:
  push:
    branches:
      - "development"
      - "main"
env:
  ETHERPAD_REPOSITORY: ether/etherpad-lite
  ETHERPAD_TAG: 2.0.3
  DOCKERHUB_REPOSITORY: xxx/xxx

jobs:
  docker:
    name: Build & Push
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          repository: ${{ env.ETHERPAD_REPOSITORY }}
          ref: ${{ env.ETHERPAD_TAG }}

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v3

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Login to Docker Hub
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      - name: Build and push
        uses: docker/build-push-action@v5
        with:
          context: .
          file: ./Dockerfile
          target: production
          build-args: |
            ETHERPAD_PLUGINS="ep_headings2"
            INSTALL_ABIWORD=true
          platforms: linux/amd64,linux/arm64
          push: true
          tags: ${{ env.DOCKERHUB_REPOSITORY }}:latest
          cache-from: type=registry,ref=${{ env.DOCKERHUB_REPOSITORY }}:latest
          cache-to: type=inline

      - name: Update description
        uses: peter-evans/dockerhub-description@v4
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
          repository: ${{ env.DOCKERHUB_REPOSITORY }}

Expected behavior A successful build.

Logs

2024-05-28T09:22:18.5904689Z #38 14.59 Error: Failed to get package '"ep_headings2"' Response error 404 Not Found
2024-05-28T09:22:18.5905800Z #38 14.59     at Object.<anonymous> (/opt/etherpad-lite/node_modules/.pnpm/[email protected]/node_modules/live-plugin-manager/src/httpUtils.ts:44:9)
2024-05-28T09:22:18.5906640Z #38 14.59     at Generator.next (<anonymous>)
2024-05-28T09:22:18.5907564Z #38 14.59     at fulfilled (/opt/etherpad-lite/node_modules/.pnpm/[email protected]/node_modules/live-plugin-manager/dist/src/httpUtils.js:28:58)
2024-05-28T09:22:18.5908746Z #38 14.59     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-05-28T09:22:18.5909268Z #38 14.59 
2024-05-28T09:22:18.5909477Z #38 14.59 Node.js v22.2.0
2024-05-28T09:22:18.5909784Z #38 14.60 /opt/etherpad-lite/bin:
2024-05-28T09:22:18.5910583Z #38 14.60  ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  [email protected] install-plugins: `node --import tsx ./installPlugins.ts "\"ep_headings2\""`
2024-05-28T09:22:18.5911277Z #38 14.60 Exit status 1
2024-05-28T09:22:18.5911697Z #38 14.63  ELIFECYCLE  Command failed with exit code 1.
2024-05-28T09:22:18.5913401Z #38 ERROR: process "/bin/sh -c bin/installDeps.sh && rm -rf ~/.npm && rm -rf ~/.local && rm -rf ~/.cache &&     if [ ! -z \"${ETHERPAD_PLUGINS}\" ] || [ ! -z \"${ETHERPAD_LOCAL_PLUGINS}\" ]; then         pnpm run install-plugins ${ETHERPAD_PLUGINS} ${ETHERPAD_LOCAL_PLUGINS:+--path ${ETHERPAD_LOCAL_PLUGINS}};     fi" did not complete successfully: exit code: 1

lucaguindani avatar May 28 '24 10:05 lucaguindani

Nevermind, I found the issue. Quotation marks should not be used for the ETHERPAD_PLUGINS value. Working fine without them.

lucaguindani avatar May 28 '24 12:05 lucaguindani