@@ -63,6 +63,8 @@ pub fn handle_docker_init(config_path: String, output_dir: String) -> Result<()>
63
63
let builder_events_port = 30000 ;
64
64
let mut builder_events_modules = Vec :: new ( ) ;
65
65
66
+ let mut exposed_ports_warn = Vec :: new ( ) ;
67
+
66
68
// setup pbs service
67
69
targets. push ( PrometheusTargetConfig {
68
70
targets : vec ! [ format!( "cb_pbs:{metrics_port}" ) ] ,
@@ -172,7 +174,8 @@ pub fn handle_docker_init(config_path: String, output_dir: String) -> Result<()>
172
174
let ( k, v) = get_env_val ( BUILDER_SERVER_ENV , & env) ;
173
175
pbs_envs. insert ( k, v) ;
174
176
}
175
-
177
+ exposed_ports_warn
178
+ . push ( format ! ( "pbs has an exported port on {}" , cb_config. pbs. pbs_config. port) ) ;
176
179
let pbs_service = Service {
177
180
container_name : Some ( "cb_pbs" . to_owned ( ) ) ,
178
181
image : Some ( cb_config. pbs . docker_image ) ,
@@ -310,7 +313,7 @@ pub fn handle_docker_init(config_path: String, output_dir: String) -> Result<()>
310
313
name : None ,
311
314
} ) ,
312
315
) ;
313
-
316
+ exposed_ports_warn . push ( "prometheus has an exported port on 9090" . to_string ( ) ) ;
314
317
let prometheus_service = Service {
315
318
container_name : Some ( "cb_prometheus" . to_owned ( ) ) ,
316
319
image : Some ( "prom/prometheus:latest" . to_owned ( ) ) ,
@@ -324,6 +327,7 @@ pub fn handle_docker_init(config_path: String, output_dir: String) -> Result<()>
324
327
services. insert ( "cb_prometheus" . to_owned ( ) , Some ( prometheus_service) ) ;
325
328
326
329
if cb_config. metrics . use_grafana {
330
+ exposed_ports_warn. push ( "grafana has an exported port on 3000" . to_string ( ) ) ;
327
331
let grafana_service = Service {
328
332
container_name : Some ( "cb_grafana" . to_owned ( ) ) ,
329
333
image : Some ( "grafana/grafana:latest" . to_owned ( ) ) ,
@@ -347,7 +351,7 @@ pub fn handle_docker_init(config_path: String, output_dir: String) -> Result<()>
347
351
348
352
services. insert ( "cb_grafana" . to_owned ( ) , Some ( grafana_service) ) ;
349
353
}
350
-
354
+ exposed_ports_warn . push ( "cadvisor has an exported port on 8080" . to_string ( ) ) ;
351
355
services. insert (
352
356
"cb_cadvisor" . to_owned ( ) ,
353
357
Some ( Service {
@@ -377,6 +381,13 @@ pub fn handle_docker_init(config_path: String, output_dir: String) -> Result<()>
377
381
let compose_path = Path :: new ( & output_dir) . join ( CB_COMPOSE_FILE ) ;
378
382
// TODO: check if file exists already and avoid overwriting
379
383
std:: fs:: write ( & compose_path, compose_str) ?;
384
+ if !exposed_ports_warn. is_empty ( ) {
385
+ println ! ( "\n " ) ;
386
+ for exposed_port in exposed_ports_warn {
387
+ println ! ( "Warning: {}" , exposed_port) ;
388
+ }
389
+ println ! ( "\n " ) ;
390
+ }
380
391
println ! ( "Compose file written to: {:?}" , compose_path) ;
381
392
382
393
// write envs to .env file
0 commit comments