Error running Docker buildx
jkohlin opened this issue · 1 comments
jkohlin commented
I get this error. Do src folder in electron folder.
ERROR: failed to solve: failed to compute cache key: "/electron/src/out/release-arm64/dist.zip" not found: not found
I've run I've run yarn
But when I run yarn gclient
I get this error:
yarn run v1.22.19
$ scripts/gclient.sh
+ cd electron
+ gclient sync --with_tags
scripts/gclient.sh: line 7: gclient: command not found
error Command failed with exit code 127.
fathyb commented
I made some changes to the docker build to support incremental building. I'm going to update the readme but in the meantime here are the steps to build the Docker image; you should only run them in Linux on x64 processors, it can work on Windows or macOS but it'll be extremely slow due to file sharing:
# It needs to be in /app for now
$ mkdir /app && cd /app
# Create the build environment
$ docker build . --target build-env --tag html2svg-build-env
# Clone the Chromium/Electron code
$ docker run -ti -v $(pwd):$(pwd) html2svg-build-env scripts/gclient.sh --revision "src/electron@cb22573c3e76e09df9fbad36dc372080c04d349e"
# Apply html2svg patches
$ docker run -ti -v $(pwd):$(pwd) html2svg-build-env scripts/patch.sh
# Install build dependencies
$ docker run -ti -v $(pwd):$(pwd) html2svg-build-env electron/src/build/install-build-deps.sh
Now you'll need architecture-specific commands:
AMD64
# Fetch compiler files
$ docker run -ti -v $(pwd):$(pwd) html2svg-build-env electron/src/build/linux/sysroot_scripts/install-sysroot.py --arch=amd64
# Generate build files
$ docker run -ti -v $(pwd):$(pwd) --workdir $(pwd)/electron/src html2svg-build-env gn gen "out/release-amd64" --args="import(\"//electron/build/args/release.gn\") cc_wrapper=\"ccache\""
# Build binaries
$ docker run -ti -v $(pwd):$(pwd) html2svg-build-env scripts/ninja.sh release-amd64
# Strip debug info from binaries (cuts size from ~1.3 GB to ~95 MB)
$ docker run -ti -v $(pwd):$(pwd) html2svg-build-env electron/src/electron/script/strip-binaries.py -d electron/src/out/release-amd64
# Zip necessary files
$ docker run -ti -v $(pwd):$(pwd) html2svg-build-env ninja -C electron/src/out/release-amd64 electron:electron_dist_zip
ARM64
# Fetch compiler files
$ docker run -ti -v $(pwd):$(pwd) html2svg-build-env electron/src/build/linux/sysroot_scripts/install-sysroot.py --arch=arm64
# Generate build files
$ docker run -ti -v $(pwd):$(pwd) --workdir $(pwd)/electron/src html2svg-build-env gn gen "out/release-arm64" --args="import(\"//electron/build/args/release.gn\") cc_wrapper=\"ccache\" target_cpu=\"arm64\""
# Build binaries
$ docker run -ti -v $(pwd):$(pwd) html2svg-build-env scripts/ninja.sh release-arm64
# Strip debug info from binaries (cuts size from ~1.3 GB to ~95 MB)
$ docker run -ti -v $(pwd):$(pwd) html2svg-build-env electron/src/electron/script/strip-binaries.py -d electron/src/out/release-arm64 --target-cpu=arm64
# Zip necessary files
$ docker run -ti -v $(pwd):$(pwd) html2svg-build-env ninja -C electron/src/out/release-arm64 electron:electron_dist_zip
Finally, build the Docker image:
# Build Docker image
$ docker build .