emqxarchive / emqx-docker

This repository is no longer maintained, please go to https://github.com/emqx/emqx-rel/tree/master/deploy/docker
Apache License 2.0
235 stars 162 forks source link

Docker build fails /bin/sh: cc: not found #5

Closed hugdru closed 7 years ago

hugdru commented 7 years ago

Happens on commit c1c7e235b61deaee88566fbf85e62674b9d3b2e2 (Jan 20, 2017, latest)

steps git clone -b master https://github.com/emqtt/emq_docker.git cd emq_docker docker build -t emq:latest . ... Congratulations! You now have a self-contained script called "rebar" in your current working directory. Place this script anywhere in your path and you can use rebar to build OTP-compliant apps. make[2]: Leaving directory '/emqttd/.erlang.mk/rebar' /emqttd/deps/emqttd DEP lager DEP esockd DEP mochiweb DEP lager_syslog make[2]: Entering directory '/emqttd/deps/gproc' DEPEND gproc.d ERLC gproc.erl gproc_app.erl gproc_bcast.erl gproc_dist.erl gproc_info.erl gproc_init.erl gproc_lib.erl gproc_monitor.erl gproc_pool.erl gproc_ps.erl gproc_pt.erl gproc_sup.erl src/gproc_dist.erl:23: Warning: behaviour gen_leader undefined APP gproc.app.src make[2]: Leaving directory '/emqttd/deps/gproc' make[2]: Entering directory '/emqttd/deps/lager' DEP goldrush make[3]: Entering directory '/emqttd/deps/goldrush' DEPEND goldrush.d ERLC glc.erl glc_code.erl glc_lib.erl glc_ops.erl glc_run.erl gr_app.erl gr_context.erl gr_counter.erl gr_counter_sup.erl gr_manager.erl gr_manager_sup.erl gr_param.erl gr_param_sup.erl gr_sup.erl gre.erl APP goldrush.app.src make[3]: Leaving directory '/emqttd/deps/goldrush' DEPEND lager.d ERLC error_logger_lager_h.erl lager.erl lager_app.erl lager_backend_throttle.erl lager_common_test_backend.erl lager_config.erl lager_console_backend.erl lager_crash_log.erl lager_default_formatter.erl lager_file_backend.erl lager_format.erl lager_handler_watcher.erl lager_handler_watcher_sup.erl lager_manager_killer.erl lager_msg.erl lager_stdlib.erl lager_sup.erl lager_transform.erl lager_trunc_io.erl lager_util.erl APP lager.app.src make[2]: Leaving directory '/emqttd/deps/lager' make[2]: Entering directory '/emqttd/deps/esockd' DEP hexer_mk DEP gen_logger make[3]: Entering directory '/emqttd/deps/hexer_mk' make[3]: Nothing to be done for 'noop'. make[3]: Leaving directory '/emqttd/deps/hexer_mk' make[3]: Entering directory '/emqttd/deps/gen_logger' DEPEND gen_logger.d ERLC console_logger.erl error_logger_logger.erl gen_logger.erl lager_logger.erl APP gen_logger.app.src make[3]: Leaving directory '/emqttd/deps/gen_logger' DEPEND esockd.d ERLC esockd.erl esockd_acceptor.erl esockd_acceptor_sup.erl esockd_access.erl esockd_app.erl esockd_cidr.erl esockd_connection.erl esockd_connection_sup.erl esockd_gen.erl esockd_keepalive.erl esockd_listener.erl esockd_listener_sup.erl esockd_net.erl esockd_ratelimit.erl esockd_server.erl esockd_sup.erl esockd_transport.erl esockd_udp.erl APP esockd.app.src GEN rebar.config make[2]: Leaving directory '/emqttd/deps/esockd' make[2]: Entering directory '/emqttd/deps/mochiweb' DEPEND mochiweb.d ERLC mochifmt.erl mochifmt_records.erl mochifmt_std.erl mochiglobal.erl mochihex.erl mochijson.erl mochijson2.erl mochilists.erl mochilogfile2.erl mochinum.erl mochitemp.erl mochiutf8.erl mochiweb.erl mochiweb_base64url.erl mochiweb_charref.erl mochiweb_cookies.erl mochiweb_cover.erl mochiweb_headers.erl mochiweb_html.erl mochiweb_http.erl mochiweb_io.erl mochiweb_mime.erl mochiweb_multipart.erl mochiweb_request.erl mochiweb_response.erl mochiweb_session.erl mochiweb_util.erl mochiweb_websocket.erl APP mochiweb.app.src make[2]: Leaving directory '/emqttd/deps/mochiweb' make[2]: Entering directory '/emqttd/deps/lager_syslog' DEP syslog make[3]: Entering directory '/emqttd/deps/syslog' make -f c_src/Makefile.erlang.mk make[4]: Entering directory '/emqttd/deps/syslog' cc -c -o c_src/syslog_drv.o c_src/syslog_drv.c -finline-functions -Wall -fPIC -I "/usr/lib/erlang/erts-7.3.1/include" -I "/usr/lib/erlang/lib/erl_interface-3.8.2/include" -fPIC /bin/sh: cc: not found c_src/Makefile.erlang.mk:8: recipe for target 'c_src/syslog_drv.o' failed make[4]: Leaving directory '/emqttd/deps/syslog' make[4]: [c_src/syslog_drv.o] Error 127 Makefile:22: recipe for target 'pre-app' failed make[3]: Leaving directory '/emqttd/deps/syslog' make[3]: [pre-app] Error 2 make[2]: [deps] Error 2 ../../erlang.mk:312: recipe for target 'deps' failed make[2]: Leaving directory '/emqttd/deps/lager_syslog' ../../erlang.mk:312: recipe for target 'deps' failed make[1]: Leaving directory '/emqttd/deps/emqttd' make[1]: [deps] Error 2 make: *** [deps] Error 2 erlang.mk:310: recipe for target 'deps' failed ...

vidhill commented 7 years ago

I saw this same error, the Dockerfile needs to also install gcc

hugdru commented 7 years ago

Even installing gcc, musl and musl-dev I get another error: make[1]: Leaving directory '/emqttd/deps/emq_coap' ===> Starting relx build process ... ===> Resolving OTP Applications from directories: /emqttd/deps /usr/lib/erlang/lib /emqttd/apps ===> Failed to solve release: Dependency emq_mod_retainer is specified as a dependency but is not reachable by the system.

erlang.mk:2475: recipe for target 'relx-rel' failed

vidhill commented 7 years ago

Yes, That is the same issue I was experiencing, I created a separate issue for that here: https://github.com/emqtt/emq-relx/issues/24 Is that the correct place for it?

vidhill commented 7 years ago

-I have a temporary workaround also, it's in my other issue above

vidhill commented 7 years ago

It appears that @turtleDeng has made a commit that should sort the first cc dependency issue: https://github.com/emqtt/emq-docker/commit/d7dc1c3e4f730cad7951fe8f32346645d2f9710a

emqplus commented 7 years ago

@hugdru @vidhill We fixed the dependency error in emq-relx project and tagged this project:

git clone -b v2.0.7 https://github.com/emqtt/emq_docker.git
cd emq_docker
docker build -t emq:latest .