#Best way to migrate existing Dockerfile

1 messages · Page 1 of 1 (latest)

opal robin
#

I'm new to Dagger, and I'm looking into the best way to migrate a production Docker file. The Dockerfile looks like this:

## Install dependencies
RUN apt-get update                                              \
    && apt-get install --assume-yes --no-install-recommends     \
        apt-transport-https                                     \
        ca-certificates                                         \
        gcc-4.9                                                 \
        liblog4cxx10-dev                                        \
        libssl-dev                                              \
        openssh-client                                          \
        openssh-server                                          \
        patch                                                   \
        wget                                                    \
        zlib1g-dev                                              \
    && apt-get install --assume-yes --no-install-recommends     \
        --target-release trusty                                 \
        libprotobuf-dev                                         \
    && rm -rf /var/lib/apt/lists/*

In order to put this into a Dagger Python function, it looks like I would have to write a lot of lists of strings to pass them as arguments to with_exec. So, it would look like this:

dag.container()...
.with_exec(["apt-get", "update"])
.with_exec(["apt-get", "install", "--assume-yet"...

Turning these long commands into a Python list of strings does not seem very productive. At least, in the Dockerfile, I could easily copy & paste the commands to try them out. What am I missing? What's the best way to go about a complex Dockerfile?