This Dockerfile builds a container holding a real rebar.lock, for verifying the
software inventory extraction plugin proposed in:
- Approved PRP issue: google/osv-scalibr#1952
- Pull request: google/osv-scalibr#2404
Distribution method: rebar3 / rebar.lock, the lockfile of the standard Erlang/OTP
build tool. Packages come from the Hex package manager.
OSV ecosystems: Hex, plus GIT for git-pinned dependencies.
The image does not ship a hand-written fixture. It runs rebar3 lock during the build, so the
rebar.lock inside the image is genuinely produced by the build tool. The dependency set is
chosen to exercise all three cases the extractor handles:
| Case | Dependency | Expected result |
|---|---|---|
| Plain Hex package | jsx, cf, quickrand |
reported against ecosystem Hex |
| hex.pm name differs from OTP app name | app uuid, hex package uuid_erl |
reported as uuid_erl, not uuid |
| Git-pinned dependency | erlware_commons @ tag v1.5.0 |
reported against ecosystem GIT with repo + commit, not as a Hex package |
The build has a self-check step that fails loudly if any of those three entries is missing, so the image cannot be published in a state that is not useful for verification.
docker build -t rebarlock-testbed .
docker run --rm rebarlock-testbed # prints the lockfile the image containsTo scan it with OSV-SCALIBR:
docker run --rm rebarlock-testbed cat /app/rebar.lock > rebar.lock
scalibr --extractors=erlang/rebarlock --root=. --result=-Built and run successfully (podman 3.4.4, base erlang:27.3.4-alpine = Erlang/OTP 27.3.4.17
with rebar3 3.27.0; resulting image 115 MB). docker run --rm rebarlock-testbed prints:
{"1.2.0",
[{<<"cf">>,{pkg,<<"cf">>,<<"0.3.1">>},1},
{<<"erlware_commons">>,
{git,"https://github.com/erlware/erlware_commons.git",
{ref,"6f7a32487a27efe3e2824923b5bf5643c20c21e6"}},
0},
{<<"jsx">>,{pkg,<<"jsx">>,<<"3.1.0">>},0},
{<<"quickrand">>,{pkg,<<"quickrand">>,<<"2.0.7">>},1},
{<<"uuid">>,{pkg,<<"uuid_erl">>,<<"2.0.6">>},0}]}.Note {<<"uuid">>,{pkg,<<"uuid_erl">>,...}}: the OTP application is uuid while the hex.pm
package is uuid_erl. An extractor that reports the application name here would produce a
package name that does not exist on hex.pm and would never match an OSV record.