./launcher enter app rebuilds everything

Inexperienced user here, with the following few lines of transcript to seed discussion:

# ./launcher enter app                                                                                                                                                                         
x86_64 arch detected.                                                                                                                                                                                                   
                                                                                                                                                                                                                        
WARNING: We are about to start downloading the Discourse base image                                                                                                                                                     
This process may take anywhere between a few minutes to an hour, depending on your network speed                                                                                                                        
                                                                                                                                                                                                                        
Please be patient                                                                                                                                                                                                       
                                                                                                                                                                                                                        
2.0.20240602-0023: Pulling from discourse/base                                                                                                                                                                          
728328ac3bde: Extracting [=============================>                     ]  18.68MB/31.43MB                                                                                                                         
1c0ca3c0af81: Download complete
...

This is not what I expected to happen.

Entering the command docker ps shows me that there is a container with some flavour of Discourse already running. All I want to do is get a shell in that running container … not to rebuild the whole app. Indeed, inside the ./launcher script (around line 746) it looks like the enter command for ./launcher is supposed to eventually do what I did expect … namely, issue the command

docker exec -it app /bin/bash

Is there a compelling reason to do a bunch of other work before doing this? If so, please enlighten me; if not, perhaps someone with experience and skill can transform this question into a useful suggestion. Thanks.

1 Like

Yeah, it has been doing that for at least a year. Fortunately, it doesn’t usually take very long downloading a new image, and it doesn’t seem to do much else before landing you in the shell.

It does rather unnecessarily seem to clutter the drive though with a bunch of images that aren’t ever used. Perhaps they have some purpose that isn’t immediately apparent.

This looks like a bug? Why should attempting to enter the container download a new image?

I notice it only does this once … if you run ./launcher enter app a second time, it skips the image check. Maybe there is some trade-off here …

Isn’t that because at that point the image is already downloaded?

Yes but why would it do it in the first place?

You are trying to enter the existing container. That’s all.

It does git pull and pulls a new image because when it didn’t a bunch of people had trouble because stuff was out of date.

If you have a reason not to do a pull then do a docker run command instead.

1 Like

I thought this might be the reason. Balancing stone-cold logic with the quirks of user expectations is never straightforward.

I had to learn this the hard way. Now that I know it, I can understand the design decision.

Thanks for the replies, and the excellent software.

1 Like

It’s not rebuilding the whole container. It’s just doing a git pull of docker_discourse and pulling fresh base images and then putting in into the contain as you expect. That’s why after the first time it doesn’t do that anymore. Unless you are exceedingly low on disk space or 10-30 seconds is a lot of time, it’s not really a problem.

2 Likes