lenra-io / devtool

GNU Affero General Public License v3.0
5 stars 1 forks source link

Cannot build devtools image locally #121

Closed jonas-martinez closed 2 years ago

jonas-martinez commented 2 years ago

Linked to https://github.com/lenra-io/dev-tools/pull/135

What should be done

I cannot build devtools image locally. The first problem is where we specified in the .dockerignore to ignore the deps folder which means that the Docker image will try to fetch the dependency repositories online but it doesn't have the github access token.

The second problem occurs when the docker image tries to compile the dependencies :

==> dev_tools
** (Mix) Could not compile dependency :erlexec, "/root/.mix/rebar3 bare compile --paths /app/_build/prod/lib/*/ebin" command failed. You can recompile this dependency with "mix deps.compile erlexec", update it with "mix deps.update erlexec" or clean it with "mix deps.clean erlexec"
The command '/bin/sh -c mix phx.digest' returned a non-zero code: 1
jonas-martinez commented 2 years ago

This issue cannot be fixed properly for the moment, this will be fixed when all the repositories used by devtools are made public.

For the moment you can use this workaround to build the image :

Workaround

Add these two arguments to the docker build command:

The complete build command should look like this : docker build --build-arg GH_PERSONNAL_TOKEN=your_gh_token --build-arg CI=true -t lenra/devtools .

You can generate your GH_PERSONNAL_TOKEN by following the instructions here https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token

I'm referencing this workaround in the README for the moment so that anyone can build the docker image without much trouble.

jonas-martinez commented 2 years ago

The repositories used by devtools are now public, this issue can be closed.