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 Use Your local SSH Keys Inside a Docker Container | by David Barral | Trabe | Medium) 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?