Chris
Chris

Reputation: 31266

How do I support two clauses in a From statement: one for buildah, and one for docker?

In Jenkins over AWS, it has recently become hard to use docker-within-docker as it is no longer supported and may in fact be "disabled". I say may because it was intentionally disabled for security reasons, but there may be some way or another to do it.

However, an easier, or at least one of the recommended paths forward in Jenkins on AWS is to use Buildah. Buildah can pull a docker image given the following FROM statement:

FROM docker://balenalib/amd64-debian:bullseye-run

When building locally via docker, that statement is invalid and cannot be parsed:

Dockerfile:1
--------------------
   1 | >>> FROM docker://balenalib/amd64-debian:bullseye-run
   2 |
   3 |     RUN apt-get update
--------------------
ERROR: failed to solve: failed to parse stage name "docker://balenalib/amd64-debian:bullseye-run": invalid reference format

Is there some way to support both docker and buildah with some kind of dual FROM statement?

In shell flavored pseudo code, is anything like this possible:

FROM docker://balenalib/amd64-debian:bullseye-run || FROM balenalib/amd64-debian:bullseye-run

Upvotes: 0

Views: 11

Answers (0)

Related Questions