fireproofsocks

fireproofsocks

Docker build: failed to compute cache key: "/app/_build/rel/my_app" not found: not found

I’m trying to get a working Dockerfile – I started with mix phx.gen.release --docker and that was a great start. I had to tweak a few things (as expected). I’m figuring out how to get an SSH key in there (using https://medium.com/trabe/use-your-local-ssh-keys-inside-a-docker-container-ea1d117515dc) so I can checkout private packages. I added a chunk something like this:

RUN useradd -m user
RUN mkdir -p /home/user/.ssh
COPY id_rsa /home/user/.ssh/id_rsa
RUN chown -R user:user /home/user/.ssh
RUN echo "Host *.github.com\n\tStrictHostKeyChecking no\n" >> /home/user/.ssh/config
RUN echo "github.com,140.82.113.3 ssh-rsa xxxxxxx\n" >> /home/user/.ssh/known_hosts
USER user

And that almost gets the thing to build via docker build .

 => ERROR [stage-1 6/6] COPY --from=builder --chown=nobody:root /app/_build/rel/my_app ./                                                    0.0s
------
 > [stage-1 6/6] COPY --from=builder --chown=nobody:root /app/_build/rel/my_app ./:
------
failed to compute cache key: "/app/_build/rel/my_app" not found: not found

I have a custom build location:

  defp releases do
    [
      my_app: [
        include_executables_for: [:unix],
        steps: [:assemble, :tar],
        overlays: ["envs/", "priv/", "config/"],
        path: "_build/rel"
      ]
    ]
  end

But I can’t quite figure out what needs to change to make this work. Can anyone point me in the right direction?

Most Liked

ollien

ollien

FYI, I know you figured this out, but as an aside, you might consider using ssh-keyscan to populate that known_hosts file, rather than a single IP address. Of course this is at build-time, so the public key and/or addresses may change at any time after the image is built, so you may consider doing it at runtime, but I thought you might find it useful either way :slight_smile:

Where Next?

Popular in Questions Top

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
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Other popular topics Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
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
hariharasudhan94
I would like to know what is the best IDE for elixir development?
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
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New

We're in Beta

About us Mission Statement