oss-fuzz icon indicating copy to clipboard operation
oss-fuzz copied to clipboard

How to build base images?

Open DavidKorczynski opened this issue 2 months ago • 1 comments

Following the recent changes in base images, it's unclear how to build them now.

Previously, we could run:

git clone https://github.com/google/oss-fuzz
cd oss-fuzz
infra/base-images/all.sh

This is no longer available.

The instructions https://github.com/google/oss-fuzz/blob/4d9a4f15100bcac3990234d82e3611e3762d6e69/infra/base-images/all.sh#L24-L28 doesn't work for me:

git clone https://github.com/google/oss-fuzz
cd oss-fuzz/infra/base-images
./all.sh
...
+ VERSION_TAG=latest
+++ dirname ./all.sh
++ cd .
++ pwd
+ SCRIPT_DIR=/home/dav/code/oss-fuzz-base-images/oss-fuzz/infra/base-images
++ python3 /home/dav/code/oss-fuzz-base-images/oss-fuzz/infra/base-images/list_images.py
Traceback (most recent call last):
  File "/home/dav/code/oss-fuzz-base-images/oss-fuzz/infra/base-images/list_images.py", line 30, in <module>
    import base_images
  File "/home/dav/code/oss-fuzz-base-images/oss-fuzz/infra/build/functions/base_images.py", line 32, in <module>
    import build_lib
  File "/home/dav/code/oss-fuzz-base-images/oss-fuzz/infra/build/functions/build_lib.py", line 39, in <module>
    from oauth2client import service_account as service_account_lib
ModuleNotFoundError: No module named 'oauth2client'
+ IMAGE_LIST=

Furthermore, after installing various Python modules:

$ ./all.sh 
+ VERSION_TAG=latest
+++ dirname ./all.sh
++ cd .
++ pwd
+ SCRIPT_DIR=/home/dav/code/oss-fuzz-base-images/oss-fuzz/infra/base-images
++ python3 /home/dav/code/oss-fuzz-base-images/oss-fuzz/infra/base-images/list_images.py
/home/dav/code/oss-fuzz-base-images/oss-fuzz/.venv/lib/python3.11/site-packages/google/api_core/__init__.py:20: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  from pkg_resources import get_distribution
Traceback (most recent call last):
  File "/home/dav/code/oss-fuzz-base-images/oss-fuzz/infra/base-images/list_images.py", line 32, in <module>
    for image_config in base_images.BASE_IMAGES:
                        ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'base_images' has no attribute 'BASE_IMAGES'. Did you mean: 'BASE_IMAGE_DEFS'?
+ IMAGE_LIST=

DavidKorczynski avatar Oct 18 '25 10:10 DavidKorczynski

Had to pip install oauth2client google-cloud-storage google-api-python-client google-auth on the host to work around this.

yawkat avatar Nov 06 '25 12:11 yawkat