# Building Julia 0.6 executable in a docker container

**URL:** <https://discourse.julialang.org/t/building-julia-0-6-executable-in-a-docker-container/3464>\
**Category:** General Usage\
**Created:** [May 1, 2017, 5:59pm UTC](https://discourse.julialang.org/t/building-julia-0-6-executable-in-a-docker-container/3464 "2017-05-01T17:59:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmeister747](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@cmeister747](https://discourse.julialang.org/u/cmeister747)\
**Post date:** [May 1, 2017, 5:59pm UTC](https://discourse.julialang.org/t/building-julia-0-6-executable-in-a-docker-container/3464/1 "2017-05-01T17:59:22Z")

</div>

Has anyone tried to build the Julia 0.6 executable from the source code? I’m trying to do so in a Docker container and running `make` (or `sudo make`) produces \>100 errors. Any advice would be very appreciated!

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [May 1, 2017, 8:16pm UTC](https://discourse.julialang.org/t/building-julia-0-6-executable-in-a-docker-container/3464/2 "2017-05-01T20:16:28Z")

</div>

This Dockerfile works for me. You probably want more packages for doing any real work but this is enough to build Julia.

```julia
FROM ubuntu:16.04

RUN apt-get update \
 && apt-get install -y build-essential cmake curl gfortran git m4 python

RUN cd /opt \
 && git clone https://github.com/JuliaLang/julia.git \
 && cd julia \
 && make -j8

```

---

<div class="post-metadata">

**Author:** ![anon94023334](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Post date:** [May 1, 2017, 8:54pm UTC](https://discourse.julialang.org/t/building-julia-0-6-executable-in-a-docker-container/3464/3 "2017-05-01T20:54:31Z")

</div>

It works for me as well - I didn’t use a dockerfile. Here are the packages I needed to install:

gcc, cmake, gfortran, g++, xz-utils, python, bzip2, m4

---

<div class="post-metadata">

**Author:** ![cmeister747](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@cmeister747](https://discourse.julialang.org/u/cmeister747)\
**Post date:** [May 2, 2017, 1:52am UTC](https://discourse.julialang.org/t/building-julia-0-6-executable-in-a-docker-container/3464/4 "2017-05-02T01:52:30Z")

</div>

Thank you for your responses! So I have all of the above packages. Running `make -j8` seems to finish but no executable is produced. Is there something obvious that I’m missing here??

---

<div class="post-metadata">

**Author:** ![anon94023334](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Post date:** [May 2, 2017, 2:36am UTC](https://discourse.julialang.org/t/building-julia-0-6-executable-in-a-docker-container/3464/5 "2017-05-02T02:36:34Z")

</div>

From the root of the source directory, it’s in `usr/bin/julia`, and there should be a symlink from the root.

---

<div class="post-metadata">

**Author:** ![cmeister747](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@cmeister747](https://discourse.julialang.org/u/cmeister747)\
**Post date:** [May 2, 2017, 5:46pm UTC](https://discourse.julialang.org/t/building-julia-0-6-executable-in-a-docker-container/3464/6 "2017-05-02T17:46:27Z")

</div>

Right, there’s no executable in `usr/bin/`. The directory is created during the make but then is empty. Once the make finishes, I get the (very descriptive) message `make: *** [julia-deps] Error 2` but that’s the only red flag I see…

---

<div class="post-metadata">

**Author:** ![anon94023334](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Post date:** [May 2, 2017, 7:23pm UTC](https://discourse.julialang.org/t/building-julia-0-6-executable-in-a-docker-container/3464/7 "2017-05-02T19:23:25Z")

</div>

That error is a fatal error. Look several lines above it for the reason it happened. (Likely a missing dependency.)

---

<div class="post-metadata">

**Author:** ![anon94023334](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Post date:** [May 2, 2017, 7:27pm UTC](https://discourse.julialang.org/t/building-julia-0-6-executable-in-a-docker-container/3464/8 "2017-05-02T19:27:40Z")

</div>

Also - when you run into errors like this, it’s best to build serially (that is, without `-j`) while you troubleshoot. Sometimes race conditions (that won’t exist in a serial build) are the cause of build failures.

---

<div class="post-metadata">

**Author:** ![cmeister747](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@cmeister747](https://discourse.julialang.org/u/cmeister747)\
**Post date:** [May 4, 2017, 7:11pm UTC](https://discourse.julialang.org/t/building-julia-0-6-executable-in-a-docker-container/3464/9 "2017-05-04T19:11:39Z")

</div>

Found the dependency issues! `apt-get` wasn’t updating my version of cmake which caused the other issues. Got it to work once I cleaned the OpenBlas build, reinstalled the julia dependencies and then ran the julia `download_cmake.sh` script. Thank you for your help!
