Running RunNginx in the Background with a Goroutine

After trying to wait for docker pull nginx:latest to finish, I wanted to try another approach…

This time, I changed the handler to run go jobs.RunNginx() in the background using a goroutine.

Because of that, when I click Fetch Nginx (pull) in the frontend, the response now returns instantly as: {"status": "success"}

So from the frontend side, it feels much faster… the backend responds immediately, while the actual Docker pull keeps running in the background.

To prove that the process was really running in the background, I also recorded a terminal demo where I kept checking: docker images | grep nginx

At first, nothing showed up… but after checking it a few times, the nginx image finally appeared. That confirmed the background job had finished successfully.

This felt like a nice step forward… but it also revealed a new problem.

The frontend can get an instant response, but it still cannot capture the current status of the process running in the goroutine. So it feels fast… but it is still blind.

Here’s the demo video…

© 2026 Wahyu Syahputra. All rights reserved.