exec format error during langgraph docker deployment #462

Closed
opened 2026-02-20 17:40:15 -05:00 by yindo · 2 comments
Owner

Originally created by @mingxuan-he on GitHub (Feb 15, 2025).

Checked other resources

  • This is a bug, not a usage question. For questions, please use GitHub Discussions.
  • I added a clear and detailed title that summarizes the issue.
  • I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
  • I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue.

Example Code

docker pull $DOCKERHUB_USERNAME/my-langgraph-server:latest
docker run -it --rm $DOCKERHUB_USERNAME/my-langgraph-server:latest

Error Message and Stack Trace (if applicable)

exec /storage/entrypoint.sh: exec format error
exec /storage/entrypoint.sh: exec format error
exec /storage/entrypoint.sh: exec format error

Description

I'm using langgraph-cli in Github Actions to build the docker image automatically with langgraph build. I'm following instructions (and using the docker-compose file) from the docs here. Local testing with docker desktop works. However the built container keeps emitting exec format error when deployed on my Ubuntu server.

Debugging with Sonnet suggests it's an issue with incompatible architectures. I'm wondering if there is a way to use langgraph build with arguments. Any help appreciated!

.github/workflows/main.yml:

name: Build Docker Image

on:
  push:
    branches: [main]

jobs:
  build-push:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.12'

      - name: Build Docker image with Langgraph
        run: |
          pip install -U langgraph-cli
          cd yuichan
          langgraph build -t my-langgraph-server

      - name: Login to Docker Registry
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      - name: Push Docker image
        run: |
          docker tag my-langgraph-server ${{ secrets.DOCKERHUB_USERNAME }}/my-langgraph-server:latest
          docker push ${{ secrets.DOCKERHUB_USERNAME }}/yui-langgraph-server:latest

langgraph.json:

{
    "dependencies": ["."],
    "graphs":{
        "yui": "./yuichan.py:graph"
    },
    "env": ".env",
    "python_version": "3.12"
}

System Info

  • Ubuntu 24.04
  • arm64 VPS on Oracle Cloud
  • Docker version 27.4.1

requirements.txt:
langchain-core
langchain[openai,anthropic,groq,google-genai]
langchain-community
langchain-experimental
langchain-google-community[gmail]
langchainhub
langsmith
langgraph
langgraph-sdk
langgraph-checkpoint-postgres
pydantic

Originally created by @mingxuan-he on GitHub (Feb 15, 2025). ### Checked other resources - [x] This is a bug, not a usage question. For questions, please use GitHub Discussions. - [x] I added a clear and detailed title that summarizes the issue. - [x] I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example). - [x] I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue. ### Example Code ```python docker pull $DOCKERHUB_USERNAME/my-langgraph-server:latest docker run -it --rm $DOCKERHUB_USERNAME/my-langgraph-server:latest ``` ### Error Message and Stack Trace (if applicable) ```shell exec /storage/entrypoint.sh: exec format error exec /storage/entrypoint.sh: exec format error exec /storage/entrypoint.sh: exec format error ``` ### Description I'm using langgraph-cli in Github Actions to build the docker image automatically with `langgraph build`. I'm following instructions (and using the docker-compose file) [from the docs here](https://langchain-ai.github.io/langgraph/how-tos/deploy-self-hosted/#using-docker-compose). Local testing with docker desktop works. However the built container keeps emitting `exec format error` when deployed on my Ubuntu server. Debugging with Sonnet suggests it's an issue with incompatible architectures. I'm wondering if there is a way to use `langgraph build` with arguments. Any help appreciated! .github/workflows/main.yml: ``` name: Build Docker Image on: push: branches: [main] jobs: build-push: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.12' - name: Build Docker image with Langgraph run: | pip install -U langgraph-cli cd yuichan langgraph build -t my-langgraph-server - name: Login to Docker Registry uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Push Docker image run: | docker tag my-langgraph-server ${{ secrets.DOCKERHUB_USERNAME }}/my-langgraph-server:latest docker push ${{ secrets.DOCKERHUB_USERNAME }}/yui-langgraph-server:latest ``` langgraph.json: ``` { "dependencies": ["."], "graphs":{ "yui": "./yuichan.py:graph" }, "env": ".env", "python_version": "3.12" } ``` ### System Info - Ubuntu 24.04 - arm64 VPS on Oracle Cloud - Docker version 27.4.1 requirements.txt: langchain-core langchain[openai,anthropic,groq,google-genai] langchain-community langchain-experimental langchain-google-community[gmail] langchainhub langsmith langgraph langgraph-sdk langgraph-checkpoint-postgres pydantic
yindo closed this issue 2026-02-20 17:40:15 -05:00
Author
Owner

@bedatse commented on GitHub (Feb 15, 2025):

What is the architecture you use to build your Docker image?

Use langgraph docker ./Dockerfile to generate a docker file and build the image for your needed architecture with --platform flag with docker build.

@bedatse commented on GitHub (Feb 15, 2025): What is the architecture you use to build your Docker image? Use `langgraph docker ./Dockerfile` to generate a docker file and build the image for your needed architecture with `--platform` flag with `docker build`.
Author
Owner

@mingxuan-he commented on GitHub (Feb 18, 2025):

Thanks @bedatse! It worked after I specified the platform in both the dockerfile and the build command. Posting my solution here for reference:

Dockerfile: replace first line with

FROM --platform=linux/arm64 langchain/langgraph-api:3.12

.github/workflows/main.yml

name: Build and Push ARM64 Image

on:
  push:
    branches: [main]
    paths: 
      - '/app'
      - '.github/workflows/**'

jobs:
  build-push:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Set up QEMU for ARM emulation
        uses: docker/setup-qemu-action@v3

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Login to Docker Registry
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      - name: Build and Push ARM64 Image
        uses: docker/build-push-action@v5
        with:
          context: app
          platforms: linux/arm64
          push: true
          tags: ${{ secrets.DOCKERHUB_USERNAME }}/my-langgraph-server:latest
@mingxuan-he commented on GitHub (Feb 18, 2025): Thanks @bedatse! It worked after I specified the platform in both the dockerfile and the build command. Posting my solution here for reference: Dockerfile: replace first line with ``` FROM --platform=linux/arm64 langchain/langgraph-api:3.12 ``` .github/workflows/main.yml ``` name: Build and Push ARM64 Image on: push: branches: [main] paths: - '/app' - '.github/workflows/**' jobs: build-push: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Set up QEMU for ARM emulation uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to Docker Registry uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and Push ARM64 Image uses: docker/build-push-action@v5 with: context: app platforms: linux/arm64 push: true tags: ${{ secrets.DOCKERHUB_USERNAME }}/my-langgraph-server:latest ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#462