sahilpaudel

sahilpaudel

Unable to add git repo in Mix for alpine elixir

I am trying to build docker with the following Dockerfile

FROM elixir:1.8.2-alpine AS builder

WORKDIR /afterglowcode
COPY . /afterglowcode

ENV USER www-data
ENV GROUP www-data
RUN addgroup -S www-data && adduser -S www-data -G www-data

RUN apk add --no-cache git

RUN git config --global url."https://github.com/".insteadOf "git://github.com/"

RUN apk add --update bash && rm -rf /var/cache/apk/*

RUN export $(cat .env | xargs -0) && \
    mix local.hex --force && \
    mix local.rebar --force

RUN export $(cat .env | xargs -0) && mix deps.get

RUN export $(cat .env | xargs -0) && mix release

My mix.exs

defp deps do
    [
      {:phoenix, "~> 1.3.0"},
      {:phoenix_pubsub, "~> 1.0"},
      {:postgrex, ">= 0.14.0", override: true},
      {:phoenix_html, "~> 2.6"},
      {:ecto, "~> 3.1"},
      {:phoenix_live_reload, "~> 1.0", only: :dev},
      {:gettext, "~> 0.11"},
      {:cors_plug, "~> 1.2"},
      {:ja_serializer, "~> 0.14.0"},
      {:sql_dust, path: 'web/modules/sql_dust'},
      {:ecto_enum, "~> 1.2"},
      {:cowboy, "~> 1.0"},
      {:oauth2, "~> 2.0"},
      {:joken, "~> 1.1"},
      {:libsodium, "~> 0.0.3"},
      {:keccakf1600, "~> 0.0.1"},
      {:libdecaf, "~> 0.0.1"},
      {:flasked, "~> 0.4"},
      {:bodyguard, "~> 1.0.0"},
      {:httpoison, "~> 0.11.1"},
      {:csv, "~> 2.1.1"},
      {:secure_random, "~> 0.5"},
      {:ex_aws, "~> 2.0"},
      {:ex_aws_s3, "~> 2.0.2"},
      {:sweet_xml, "~> 0.6.0"},
      {:bamboo, "~> 0.8.0"},
      {:bamboo_smtp, "~> 1.4.0"},
      {:distillery, "~> 2.0", runtime: false},
      {:jason, "~> 1.1"},
      {:cachex, git: "https://github.com/whitfin/cachex.git"},
      {:quantum, "~> 2.3"},
      {:timex, "~> 3.0"},
      {:oban, "~> 0.2"},
      {:mariaex, "0.9.1", override: true},
      {:db_connection, "~> 2.0", override: true},
      {:ecto_sql, "~> 3.1.0"},
      {:plug_cowboy, "~> 1.0"},
      {:mustache, "~> 0.3.0"},
      {:numerix, "~> 0.5.1"},
      {:hackney, github: "benoitc/hackney", override: true},
      {:gen_smtp, "~> 0.14.0", override: true}
    ]
  end

Error message

* Getting cachex (https://github.com/whitfin/cachex.git)
fatal: unable to access 'https://github.com/whitfin/cachex.git/': Could not resolve host: github.com
** (Mix) Command "git --git-dir=.git fetch --force --quiet --progress" failed
The command '/bin/sh -c export $(cat .env | xargs -0) && mix deps.get' returned a non-zero code: 1

First Post!

dimitarvp

dimitarvp

Where is this run? Seems like it can’t access GitHub which is an error condition.

Where Next?

Popular in Questions Top

nobody
How to bind a phoenix app to a specific ip address? could not find anything about that, nowhere, unfortunately, but for me this is quite...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

Other popular topics Top

WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement