def export_env(print:)
      Docker::Compose::Mapper.map(host_env,
                                  session: @session,
                                  net_info: @net_info) do |k, v|
        ENV[k] = serialize_for_env(v)
        print_env(k, ENV[k]) if print
      end

      extra_host_env.each do |k, v|
        ENV[k] = serialize_for_env(v)
        print_env(k, ENV[k]) if print
      end
    end
def export_env(print:)
      Docker::Compose::Mapper.map(host_env,
                                  session: @session,
                                  net_info: @net_info) do |k, v|
        ENV[k] = serialize_for_env(v)
        print_env(k, ENV[k]) if print
      end

      extra_host_env.each do |k, v|
        ENV[k] = serialize_for_env(v)
        print_env(k, ENV[k]) if print
      end
    end
Substitute and set environment variables that point to network ports
 published by docker-compose services. Optionally also print bash export
 statements so this information can be made available to a user's shell.