Я создаю образ рабочего докера, но когда я запускаю его, я получаю:
2018-10-06 14:14:20.950098 Error in process ~p with exit value:~n~p~n
<0.670.0>
{function_clause,[{filename,join,[[]],[{file,"filename.erl"},{line,432}]},{code_server,insert_dir,2,[{file,"code_server.erl"},{line,820}]},{code_server,init_namedb,2,[{file,"code_server.erl"},{line,797}]},{code_server,init_namedb,1,[{file,"code_server.erl"},{line,793}]},{code_server,init,3,[{file,"code_server.erl"},{line,96}]}]}
Не эрланг, но похоже, что он ожидает загрузки code_server, но я отключил его вdev.exs и prod.exs.Вот мой rel / config.exs:
# Import all plugins from `rel/plugins`
# They can then be used by adding `plugin MyPlugin` to
# either an environment, or release definition, where
# `MyPlugin` is the name of the plugin module.
~w(rel plugins *.exs)
|> Path.join()
|> Path.wildcard()
|> Enum.map(&Code.eval_file(&1))
use Mix.Releases.Config,
# This sets the default release built by `mix release`
default_release: :default,
# This sets the default environment used by `mix release`
default_environment: Mix.env()
# For a full list of config options for both releases
# and environments, visit https://hexdocs.pm/distillery/config/distillery.html
# You may define one or more environments in this file,
# an environment's settings will override those of a release
# when building in that environment, this combination of release
# and environment configuration is called a profile
environment :dev do
# If you are running Phoenix, you should make sure that
# server: true is set and the code reloader is disabled,
# even in dev mode.
# It is recommended that you build with MIX_ENV=prod and pass
# the --env flag to Distillery explicitly if you want to use
# dev mode.
set dev_mode: true
set include_erts: false
set cookie: :"***********************"
end
environment :prod do
set include_erts: true
set include_src: false
set cookie: :"***********************"
end
# You may define one or more releases in this file.
# If you have not set a default release, or selected one
# when running `mix release`, the first release in the file
# will be used by default
release :app do
set version: current_version(:app)
set applications: [
:runtime_tools
]
end
release :app_web do
set version: current_version(:app_web)
set applications: [
:runtime_tools
]
end
Это мой Dockerfile:
####### BUILDER STAGE #########
ARG FROM=registry.mydomain.com/proj/proj/phoenix:master
FROM ${FROM} as builder
MAINTAINER Ron Arts <ron.arts@gmail.com>
WORKDIR ${HOME}
ADD . ${HOME}
RUN set -x \
&& mix do deps.get, credo --strict
ENV MIX_ENV=prod
RUN set -x \
&& mix phx.digest \
&& mix release --env=prod
RUN find /root/_build -name \*.gz
####### PACKAGER STAGE ##########
FROM alpine:3.6
# RUN apk add --no-cache ca-certificates openssl ncurses unixodbc zlib
RUN apk add --no-cache ncurses openssl bash
ENV VERSION 0.0.1
COPY --from=builder /root/_build/prod/rel/app/releases/$VERSION/app.tar.gz /app/app.tar.gz
WORKDIR /app
RUN tar -zxf app.tar.gz
WORKDIR /app/releases/$VERSION
ENTRYPOINT ["./app.sh"]
CMD ["foreground"]
# Start up in 'foreground' mode by default so the container stays running
Мой prod.exs:
config :project_web, Project.Endpoint,
load_from_system_env: true,
url: [host: "example.com", port: 80],
cache_static_manifest: "priv/static/cache_manifest.json",
server: true,
code_reloader: false
И это мой главныйdeps:
defp deps do
[
{:credo, "~> 0.10.0", only: [:dev, :test], runtime: false},
{:distillery, "~> 2.0"}
]
end
(это зонтичный проект).
Итак, мой вопрос: что на самом деле означает это сообщение, как его исправить?Что я могу попробовать?