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

pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
mathew4509
I have a list say x = ["23gh", "56kh", "97mh"] I would like to pass each element to Val in each iteration. Say, in iteration 1 -------...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
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 Postg...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New

Other popular topics Top

Tee
can someone please explain to me how Enum.reduce works with maps
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New

We're in Beta

About us Mission Statement