This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-27
Channels
- # beginners (35)
- # boot (111)
- # cider (12)
- # clojure (295)
- # clojure-android (2)
- # clojure-dev (12)
- # clojure-dusseldorf (9)
- # clojure-finland (1)
- # clojure-greece (7)
- # clojure-italy (24)
- # clojure-norway (1)
- # clojure-poland (7)
- # clojure-russia (14)
- # clojure-sg (1)
- # clojure-spec (29)
- # clojure-uk (25)
- # clojurebridge (1)
- # clojurescript (157)
- # clr (3)
- # cursive (3)
- # datomic (55)
- # docker (6)
- # hoplon (4)
- # juxt (11)
- # leiningen (13)
- # luminus (1)
- # lumo (3)
- # mount (1)
- # off-topic (47)
- # om (43)
- # onyx (35)
- # re-frame (33)
- # reactive (2)
- # reagent (4)
- # rum (3)
- # schema (5)
- # specter (5)
- # test-check (63)
- # vim (15)
- # yada (14)
@josh.freckleton Split your dockerfile into 2, build the first one and tag it, e.g. docker build . -t base_image
, and build the second one from the first one.
$ cat a/Dockerfile
FROM clojure
ENV A=1
$ cat b/Dockerfile
FROM image_a
ENV B=12
ENTRYPOINT ["bash"]
$ sudo docker build a -t image_a
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM clojure
---> 073eca6605b0
Step 2 : ENV A 1
---> Running in a9c4bca744fc
---> 84d9771186ba
Removing intermediate container a9c4bca744fc
Successfully built 84d9771186ba
$ sudo docker build b -t image_b
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM image_a
---> 84d9771186ba
Step 2 : ENV B 12
---> Running in 17d2f93e58d9
---> 02ad380a7db1
Removing intermediate container 17d2f93e58d9
Step 3 : ENTRYPOINT bash
---> Running in 3c46122fbe30
---> 6de067a352ed
Removing intermediate container 3c46122fbe30
Successfully built 6de067a352ed
$ sudo docker run -ti image_b
root@a12d7e23ddab:/tmp# env
A=1
B=12
...
@not-raspberry That sounds like it would work, (I'm a bit new to docker) but what do I put in the first image that pulls down my deps, and how do I allow the deps to be accessed by lein
in image B?
image 1
FROM clojure
... the code that copies the project dir ...
RUN lein deps
image 2:
FROM image_1
RUN do_something_with_that_setup
@josh.freckleton the second dockerfile will basically inherit all the state you created with the first one
ohhhh, duh, that lein deps
step, thanks!