google / google/oss-fuzz

How to build base images?

Open
#14,151 1 comment 0 reactions 1 assignee Claimed by @hunsche View on GitHub
Dominant language
Shell
Stars
12.6k
Forks
2.9k
Avg merge
2d 3h
Merged PRs (30d)
61

Description

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
import base_images
File "/home/dav/code/oss-fuzz-base-images/oss-fuzz/infra/build/functions/base_images.py", line 32, in
import build_lib
File "/home/dav/code/oss-fuzz-base-images/oss-fuzz/infra/build/functions/build_lib.py", line 39, in
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
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=
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.