我正在尝试使用Docker Ubuntu容器构建github动作。并且在webbrtc获取过程中接收一堆tar: ./usr/lib/i386-linux-gnu/libicui18n.so.67.1: Cannot change ownership to uid 376730, gid 89939: Invalid argument
类消息。我找到了--no-same-owner
tar参数的可能解决方案,但无法弄清楚如何强制tar在webtc fetch想要处理的每个。tar文件上使用它。
工作流:
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
...
和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>
添加环境变量TAR_OPTIONS
:
env:
TAR_OPTIONS: --no-same-owner