`lk agent create` docker build is stuck on `pushin...
# ask-ai
g
lk agent create
docker build is stuck on
pushing layers
- It goes on for an unreasonable amount of time, never finishing (more than 2 hours) what could be the cause of this?
t
Thanks for reaching out, Haim. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Sometimes, the "pushing layers" phase during the
lk agent create
Docker build might feel like it’s stuck, and that can be a bit frustrating. This can happen for a few reasons: • Large Docker layers: If your Dockerfile is creating layers with lots of dependencies or big files, pushing them to the registry can take some time. • Build context size: The CLI uploads your entire working directory (except what’s in
.dockerignore
), so if your context is large, it might slow things down. • Network issues: Sometimes, connectivity between your CLI and LiveKit Cloud's build service can cause delays or make it seem stuck. Here are some steps that might help you troubleshoot: 1. Keep an eye out for any build errors in real-time — look for messages starting with "BUILD ERROR:". 2. You can check detailed build logs with:
lk agent logs --log-type=build --id <agent-id>
. 3. Try optimizing your Dockerfile by reducing the image size, using multi-stage builds, and removing any unnecessary files. 4. Check how big your build context is and consider excluding files you don’t need with
.dockerignore
. 5. Make sure your network connection is stable, and if needed, try restarting the build. If you’re still running into issues after trying these, please don’t hesitate to reach out. I’m here to help you optimize your Dockerfile or project setup so we can get things moving smoothly for you. Sources: Builds and Dockerfiles | LiveKit Docs | pkg/agentfs/client.go | Log collection | LiveKit Docs