Skip to content

bundling: docker builder has permission issues with docker build -f  #3250

Closed

Description

@grouville

Our current implementation of daggerd, dagger has only one builder: docker.

In order to build our engine, we make a quine -> we copy, at runtime, our statically embed source code and build daggerd. This artifact is then served using a provisioner (docker for the moment).

To build our artifact, we rely on docker build, using the Dockerfile.daggerd Dockerfile. However, another Dockerfile exists at the root of our project. In order to run the build, we need to rely on docker build -f Dockerfile.daggerd.

Here lies the issue: it seems that docker build -f encounters permission issues in this context, which I haven't been able to workaround yet.

Current hack: cp and rename Dockerfile.daggerd as Dockerfile

Other issue: we tried to implement a single Dockerfile, with the daggerd environment implemented as a build stage (a21e06e). However, the docker build command to a specific build stage requires the -f option and creates the same permission issues

Activity

  1. changed the title [-]bundling: `docker` builder has permission issue with `docker build -f` [/-] [+]bundling: `docker` builder has permission issues with `docker build -f` [/+] on Oct 4, 2022
  2. shykes commented on Oct 4, 2022

    @shykes
    Contributor

    Is the dependency on docker build considered an ugly temporary hack? If not: why?

  3. sipsma commented on Oct 4, 2022

    @sipsma
    Contributor

    Is the dependency on docker build considered an ugly temporary hack? If not: why?

    It's the easiest way to get going for now, primarily because we already have a provisioner that uses docker, so this route added no new dependencies or concepts while also letting us move forward on the implementation.

    In general, "builder" is just the thing that will give us the daggerd that we want to provision for the target platform. I suppose "builder" is probably not the best possible term (my fault, I suggested it). Other possible implementations include:

    1. Obtaining a binary that has been embedded in the dagger binary (if we embed one for each target platform)
    2. Downloading one (from http, a container image, etc.)
    3. Building embedded source code using an embedded go compiler

    All of those may be viable options in the future, but they all have big tradeoffs+complications (sometimes not obvious) that made them unappealing for the first implementation. docker build absolutely should not be our only implementation of this in the same way that docker run should not be our only provisioner; it just is the shortest path to get going and let us iterate from there.

  4. shykes commented on Oct 5, 2022

    @shykes
    Contributor

    Thanks for the additional context @sipsma, FYI the discussion is continuing here, I didn't want to fragment by replying here, but it's relevant to your answer above.

  5. grouville commented on Dec 21, 2022

    @grouville
    MemberAuthor

    Closing. Not relevant anymore, context switched to: #4105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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