FROM <%= from %> USER root RUN useradd -m -U -d <%= CIDE_DIR %> cide # Install system build dependencies here <% as_root.each do |cmd| -%> RUN <%= cmd %> <% end -%> # Common ENV HOME <%= CIDE_DIR %> WORKDIR <%= CIDE_SRC_DIR %> # SSH config <% if use_ssh -%> ADD ssh_config <%= File.expand_path('config', CIDE_SSH_DIR) %> RUN chmod 400 <%= File.expand_path('config', CIDE_SSH_DIR) %> ADD <%= TEMP_SSH_KEY %> <%= File.expand_path('id_rsa', CIDE_SSH_DIR) %> RUN chmod 400 <%= File.expand_path('id_rsa', CIDE_SSH_DIR) %> RUN chmod 755 <%= CIDE_SSH_DIR %> RUN chown -R cide:cide <%= CIDE_DIR %> <% end %> # Before <% if before -%> <% before.forward_env.each do |key| -%> ENV <%= key %> <%= ENV[key] %> <% end %> <% before.add.each do |file| -%> ADD <%= file %> <%= File.expand_path(file, CIDE_SRC_DIR) %> <% end %> RUN chown -R cide:cide <%= CIDE_DIR %> USER cide RUN <%= before.run %> USER root <% end -%> # Add project data ADD . <%= CIDE_SRC_DIR %> RUN chown -R cide:cide <%= CIDE_DIR %>