Skip to content

Building Dockerfile is failed due to missed BuildKit #47

@ligurio

Description

@ligurio

Installation README does not mention that BuildKit 1 is required for building a Docker image. Without BuildKit
building on Ubuntu 24.04 is failed with message:

<snipped>

Step 11/11 : RUN  --mount=type=ssh     virtualenv --python python3.8 venv &&     . venv/bin/activate &&     poetry install -v &&     mkdir -p bin &&     ln -s ../venv/bin/ota
va ${OTAVA_HOME}/bin                                                                                                                                                          
the --mount option requires BuildKit. Refer to https://docs.docker.com/go/buildkit/ to learn how to build images with BuildKit enabled  

Workaround - install docker-buildx using command sudo apt install -y docker-buildx.
With the workaround, installation finished successfully:

[0] ~/sources/MRG/otava $ sudo docker build -t otava .
[+] Building 73.8s (12/12) FINISHED                                                                                                                            docker:default
 => [internal] load build definition from Dockerfile                                                                                                                     0.0s
 => => transferring dockerfile: 1.74kB                                                                                                                                   0.0s
 => [internal] load metadata for docker.io/library/python:3.8.0-slim-buster                                                                                              0.0s
 => [internal] load .dockerignore                                                                                                                                        0.0s
 => => transferring context: 252B                                                                                                                                        0.0s
 => [stage-0 1/7] FROM docker.io/library/python:3.8.0-slim-buster                                                                                                        0.0s
 => [internal] load build context                                                                                                                                        0.3s
 => => transferring context: 22.86MB                                                                                                                                     0.3s
 => [stage-0 2/7] WORKDIR /srv/otava                                                                                                                                     0.1s
 => [stage-0 3/7] RUN groupadd --gid 8192 otava &&     useradd --uid 8192 --shell /bin/false --create-home --no-log-init --gid otava otava &&     chown otava:otava /sr  0.3s
 => [stage-0 4/7] RUN apt-get update --assume-yes &&     apt-get install -o 'Dpkg::Options::=--force-confnew' -y --force-yes -q     git     openssh-client     gcc      34.6s
 => [stage-0 5/7] RUN curl -sSL https://install.python-poetry.org | python3 - --version 1.8.3                                                                           15.1s 
 => [stage-0 6/7] COPY --chown=otava:otava . /srv/otava                                                                                                                  0.2s 
 => [stage-0 7/7] RUN  --mount=type=ssh     virtualenv --python python3.8 venv &&     . venv/bin/activate &&     poetry install -v &&     mkdir -p bin &&     ln -s ..  19.2s 
 => exporting to image                                                                                                                                                   2.5s 
 => => exporting layers                                                                                                                                                  2.5s 
 => => writing image sha256:1376197235489ed68c8b813ca9166c85bc68dee194625706131659cd6e766435                                                                             0.0s 
 => => naming to docker.io/library/otava                                                                                                                                 0.0s 
[0] ~/sources/MRG/otava $   

I propose to update installation steps 2 and make instruction more detailed.

References

Footnotes

  1. https://docs.docker.com/build/buildkit/

  2. https://github.com/apache/otava/blob/66085d22a0c4375241dff86333c8e078cf0b52b3/docs/INSTALL.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions