0

i have the following dockerfile for an elixir+phoenix app

FROM elixir:latest as build_base

RUN apt-get -y update
RUN apt-get -y install inotify-tools curl

ARG TARGETARCH
RUN if [ ${TARGETARCH} = arm64 ]; then \
    curl -L -o /tmp/dart-sass.tar.gz https://github.com/sass/dart-sass/releases/download/1.54.5/dart-sass-1.54.5-linux-${TARGETARCH}.tar.gz \
;else \
    curl -L -o /tmp/dart-sass.tar.gz https://github.com/sass/dart-sass/releases/download/1.54.5/dart-sass-1.54.5-linux-x64.tar.gz \
;fi
RUN tar -xvf /tmp/dart-sass.tar.gz -C /tmp
RUN mv /tmp/dart-sass/sass /usr/local/bin/sass

RUN mkdir -p /app
WORKDIR /app

COPY mix.* ./

RUN mix local.hex --force
RUN mix archive.install hex phx_new --force
RUN mix local.rebar --force

RUN mix deps.clean --all
RUN mix deps.get
RUN mix --version
RUN mix deps.compile

COPY assets assets
COPY vendor vendor
COPY lib lib
COPY config config
COPY priv priv
COPY test test

RUN mix compile

the docker-compose file looks like the following

services:
  web:
    build:
      context: .
      dockerfile: Dockerfile
      target: build_base
    volumes:
      - ./:/app
    ports:
      - "80:80"
    command: mix phx.server

I'm trying to run docker-compose as part of the build step in buildkite, this is an extract of the step in buildkite

  - label: "run web"
    key: "web"
    commands:
      - mix phx.server
    plugins:
      - docker-compose#v4.9.0:
          run: web
          config: docker-compose.yml

however when running web i see everything happens properly including the package installation, however when running the application i see the following error

web_1   | Unchecked dependencies for environment dev:
web_1   | * telemetry_metrics (Hex package)
web_1   |   the dependency is not available, run "mix deps.get"

and the list goes on and on, this works fine on my local machine, its only when running on buildkite. does anyone have any idea on how to fix this ?

tmp dev
  • 8,043
  • 16
  • 53
  • 108
  • Which step in the Dockerfile does it fail on? Try deleting your local `deps` folder and then run `web` locally. Does the error happen now? – Peaceful James Jan 23 '23 at 14:10

0 Answers0