0

I'm trying to build webrtc using github actions with Docker Ubuntu container. And receiving bunch of tar: ./usr/lib/i386-linux-gnu/libicui18n.so.67.1: Cannot change ownership to uid 376730, gid 89939: Invalid argument like messages while webrtc fetch process. I'm found possible solution with --no-same-owner tar parameter but can't figure out how to force tar to use it on every .tar file which webrtc fetch want to process.

Workflow:

name: Build

jobs:
  build:
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: Linux
            container: ghcr.io/<company>/<name>
      ...        
    name: ${{matrix.os}}, ${{matrix.arch}}    
    runs-on: [ "self-hosted", ...]
    container: ${{ matrix.container }}
    
    steps:
      - uses: actions/checkout@v3

      - name: Build WebRTC
        if: ${{matrix.os == 'Linux'}}
        shell: bash
        run: |
          git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git depot_tools
          export PATH=$(pwd)/depot_tools:$PATH
          mkdir webrtc_build
          cd webrtc_build
          fetch --nohooks webrtc && gclient sync
    ...

And Dockerfile:

FROM ubuntu:22.04

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
    apt-get install -y sudo clang build-essential cmake git libssl-dev curl python3 && \
    ...
    rm -rf /var/lib/apt/lists/*

Docker publish workflow:

on:   
  ...
jobs:
  push:
    runs-on: [self-hosted, ...]

    steps:
      - uses: actions/checkout@v2

      - name: Build image
        run: docker build . --file Dockerfile --tag <name> --label "runnumber=${GITHUB_RUN_ID}"

  ....     

      - name: Push image
        run: |
          docker tag <name> ghcr.io/<company>/<name>
          docker push ghcr.io/<company>/<name>

lfk
  • 57
  • 7
  • Please include your minimal working workflow in your question to reproduce this. Thanks! – Azeem Apr 13 '23 at 05:31
  • Thanks! Did you try building it without container? – Azeem Apr 13 '23 at 06:37
  • @Azeem. Yes, it works fine. But unfortunally, I have to use container – lfk Apr 13 '23 at 07:25
  • Right. That is the custom Dockerfile that you're using? Where is it being used in your workflow? – Azeem Apr 13 '23 at 07:34
  • @Azeem, there is another workflow, which publish docker image to the github. And I use it by the link in the `container` section of the main workflow. I added it to the main question as well – lfk Apr 13 '23 at 07:39
  • Got it. Did you try adding `USER root` in Dockerfile? – Azeem Apr 13 '23 at 07:52
  • @Azeem, its root already. `id` gives `uid=0(root) gid=0(root) groups=0(root)` – lfk Apr 13 '23 at 08:10
  • Right. By default, it should be unless specified otherwise. I was wondering about `uid 376730, gid 89939` and thought maybe it's related to that. – Azeem Apr 13 '23 at 08:55
  • 1
    @Azeem, I think it's related to that... I tried to create and set user in Docker file, but it leads to errors after gh actions workflow start. I tried to set user in the `Build WebRTC` step as well (`su user` which proceeds no errors), but `id` still gives `uid=0(root)...`. On the other hand I downloaded this image to my laptop, run it, changed user and it works locally. – lfk Apr 13 '23 at 09:02
  • So, setting the user manually is working fine? – Azeem Apr 13 '23 at 09:22
  • 1
    Also, see [`jobs..container.options`](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idcontaineroptions) and [`--user / -u`](https://docs.docker.com/engine/reference/commandline/create/#options). – Azeem Apr 13 '23 at 09:23
  • 1
    @Azeem, "So, setting the user manually is working fine?" - I mean it works only locally. Generally webrtc fetch works fine locally as well. But it doesn't works for gh actions. – lfk Apr 13 '23 at 09:37

1 Answers1

0

Fixed by adding environment variable TAR_OPTIONS:

    env:
      TAR_OPTIONS: --no-same-owner     
lfk
  • 57
  • 7