Ions push and deploy slow in Docker container

Does anyone have any experience pushing and deploying ions from a container? Any input is appreciated.

The application being deployed is component based following the Polylith pattern.

For some reason, pushing/deploying takes a lot longer (10 min +) compared to doing it “natively” from WSL on my Windows machine (seconds). The project directory is mounted in the container and the ions commands are executed in the running container.

For example, executing this command in the container:

 clojure -M:ion-dev '{:op :push :creds-profile my-creds :region my-region :uname my-unrep-name}'

Here is my Dockerfile:

FROM clojure

RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install curl unzip vim -y

# Install AWS CLI
RUN curl "" -o ""
RUN unzip
RUN ./aws/install

# Install Maven
RUN curl "" -o ""
RUN unzip
ENV PATH "$PATH:/tmp/apache-maven-3.8.3/bin"

# Install Polylith tool
RUN curl -L -o poly-0.1.0-alpha9.jar
RUN mkdir /usr/local/polylith
RUN mv poly-0.1.0-alpha9.jar /usr/local/polylith
COPY tooling/poly /usr/local/bin/poly
RUN sed -i 's/\r//' /usr/local/bin/poly

# Install Cognitect dev-tools
COPY ./tooling/settings.xml /root/.m2

COPY ./tooling/cognitect* ./cognitect
RUN cognitect*/install

# Copy the user deps.edn for using the ion-dev tools
COPY  ./tooling/deps.edn /root/.clojure/

# Create directory in which the repository will be mounted and all commands are executed
WORKDIR /root/tmp/app

Here is the .clojure/deps.edn used in the container:

   :deps {
     org.clojure/clojure {:mvn/version "1.10.3"}
     com.datomic/ion {:mvn/version "0.9.50"}
   :aliases {
         :deps {com.datomic/ion-dev {:mvn/version "0.9.290"}}
         :main-opts ["-m" ""]
  :mvn/repos {
    "cognitect-dev-tools" {:url ""}
    "datomic-cloud" {:url "s3://datomic-releases-1fc2183a/maven/releases"}

And here is the projects deps.edn:

{:paths     [; Base

             ; Components

 :deps      {clj-http/clj-http              {:mvn/version "3.10.0"}
             clj-oauth/clj-oauth            {:mvn/version "1.5.5"}
             clj-time/clj-time              {:mvn/version "0.15.2"}
             commons-codec/commons-codec    {:mvn/version "1.13"}
             com.amazonaws/aws-java-sdk-kms {:mvn/version "1.11.826"}
             com.amazonaws/aws-java-sdk-s3  {:mvn/version "1.11.826"}
             {:mvn/version "0.8.352"}
     {:mvn/version "746.2.533.0"}
       {:mvn/version ""}
          {:mvn/version "718.2.454.0"}
            {:mvn/version "738.2.501.0"}
              {:mvn/version "726.2.488.0"}
             {:mvn/version "737.2.498.0"}
          {:mvn/version "707.2.409.0"}
             com.cognitect/s3-creds         {:mvn/version "0.1.23"}
             com.datomic/client-cloud       {:mvn/version "0.8.102"}
             com.datomic/ion                {:mvn/version "0.9.48"}
             compact-uuids/compact-uuids    {:mvn/version "0.2.0"}
             metosin/jsonista               {:mvn/version "0.2.4"}
             metosin/reitit-core            {:mvn/version "0.3.9"}
             metosin/reitit-middleware      {:mvn/version "0.3.9"}
             metosin/reitit-ring            {:mvn/version "0.3.9"}
             metosin/reitit-spec            {:mvn/version "0.3.9"}
             metosin/spec-tools             {:mvn/version "0.10.0"}
             org.clojure/clojure            {:mvn/version "1.10.1"}
             org.clojure/core.cache         {:mvn/version "1.0.207"}
             org.clojure/data.codec         {:mvn/version "0.1.1"}
             org.clojure/data.priority-map  {:mvn/version "1.0.0"}
             org.clojure/test.check         {:mvn/version "0.10.0"}
             org.jcodec/jcodec              {:mvn/version "0.2.3"}
             org.jcodec/jcodec-javase       {:mvn/version "0.2.3"}}

 :mvn/repos {"datomic-cloud"       {:url "s3://datomic-releases-1fc2183a/maven/releases"}
             "cognitect-dev-tools" {:url ""}}

 :aliases   {:ion-dev {:extra-deps {com.datomic/ion-dev {:mvn/version "0.9.276"}}
                       :main-opts  ["-m" ""]}

             :test    {:extra-paths [; Bases

                                     ; Components

                       :extra-deps  {com.datomic/dev-local {:mvn/version "0.9.225"}
                                     mockery/mockery       {:mvn/version "0.1.4"}}}}}

Seems like this is a fairly common issue with mounted volumes in Docker. Copying the directory instead of mounting it solves the issue.

1 Like