diff --git a/.dockerignore b/.dockerignore index e189198..e10ea79 100644 --- a/.dockerignore +++ b/.dockerignore @@ -22,3 +22,4 @@ CO*.md build/test/ build/typedoc/ +test/event.* \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 40a31e6..45bfb05 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,11 +6,8 @@ RUN apk add --no-cache \ skopeo \ && skopeo --version -# container-diff -RUN curl -sLO https://storage.googleapis.com/container-diff/latest/container-diff-linux-amd64 \ - && chmod +x container-diff-linux-amd64 \ - && mv container-diff-linux-amd64 /usr/bin/container-diff \ - && container-diff version +# undock +COPY --from=crazymax/undock:0.7.0-rc.1 /usr/local/bin/undock /usr/local/bin/undock WORKDIR "/skill" diff --git a/lib/events/register_skill.ts b/lib/events/register_skill.ts index f6eb2ab..763cff3 100644 --- a/lib/events/register_skill.ts +++ b/lib/events/register_skill.ts @@ -288,28 +288,18 @@ async function downloadImage( log.info("Downloading image"); const tmpDir = await tmpFs.createDir(ctx); const imageNameWithDigest = fullImageName(ctx.data.image); - const args = ["analyze", "--type=file", imageNameWithDigest]; - const env = { ...process.env, CONTAINER_DIFF_CACHEDIR: tmpDir }; - const result = await childProcess.spawnPromise( - "container-diff", - args, - { - env, - }, - ); + const args = [ + imageNameWithDigest, + tmpDir, + "--include=skill.yaml", + "--include=datalog", + ]; + const result = await childProcess.spawnPromise("undock", args); if (result.status !== 0) { throw new Error("Failed to download layers"); } log.info(`Successfully downloaded image`); - return [ - path.join( - tmpDir, - ".container-diff", - "cache", - imageNameWithDigest.replace(/\//g, "").replace(/:/g, "_"), - ), - registry, - ] as any; + return [tmpDir, registry] as any; }, ); }