Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docker spawning issues #12

Merged
merged 2 commits into from
Mar 25, 2024
Merged

Fix docker spawning issues #12

merged 2 commits into from
Mar 25, 2024

Conversation

semanser
Copy link
Owner

Closes #11, Closes #2

2024/03/25 12:14:52 Image node:latest found: false
2024/03/25 12:14:52 Pulling image node:latest...
2024/03/25 12:14:53 Creating container exec-test...
2024/03/25 12:14:53 failed to spawn container: %!w(*fmt.wrapError=&{Error creating container: Error response from daemon: No such image: node:latest {0xc000240120}})

The problem is due to the fact that ImagePull is an async function and according to the docs:

// ImagePull requests the docker host to pull an image from a remote registry.
// It executes the privileged function if the operation is unauthorized
// and it tries one more time.
// It's up to the caller to handle the io.ReadCloser and close it properly.

This means that we never actually wait for the image to be downloaded and simply continue with the flow even if the container is still downloading.

if !imageFound {
log.Printf("Pulling image %s...\n", dockerImage)
_, err = dockerClient.ImagePull(context.Background(), dockerImage, types.ImagePullOptions{})

- Simplify the graphql schema
- Fix container loading issues
- Add a new terminal system message type
@semanser
Copy link
Owner Author

  • Added a new system messages to the terminal.
  • Fixed docker loading issues.
  • Simplified graphql schema
  • Simplified the Input processing. Now it's processed in the same queue as all the other tasks.
Screenshot 2024-03-25 at 13 27 47

@semanser semanser merged commit c7d7c5d into main Mar 25, 2024
@semanser semanser mentioned this pull request Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker startup & missing image failed to spawn container: No such image: node:latest
1 participant