Hex Cannot Be Found on Dockerized Phoenix App when running on Drone Hex Cannot Be Found on Dockerized Phoenix App when running on Drone docker docker

Hex Cannot Be Found on Dockerized Phoenix App when running on Drone


The problem is that Drone builds its own isolated working environment as an extra layer on top of your docker image, so the ENV settings in your Dockerfile are not available. You need to independently tell Drone the environment info so it knows where hex is installed.

I managed to get this working by setting MIX_HOME in the .drone.yml file:

Dockerfile:

FROM bitwalker/alpine-elixir:1.8.1RUN mix local.hex --force

.drone.yml:

pipeline:  build:    image: # built image of the above Dockerfile    environment:      MIX_HOME: /opt/app/.mix    commands:      - mix deps.get