Skip to content

[FEATURE] update docker image in docker.io #153

Closed

Description

@madanyang

Feature Description

Implement automatic docker image update as new versions are released.

Problem This Feature Solves

Currently the docker image at docker.io is reported as follows

docker run --rm mcp/basic-memory basic-memory --version
Basic Memory version: 0.12.3

Proposed Solution

Add a github action to build the latest release as a docker image and push to docker.io

Impact

Enables end-users to access latest releases of the project when using docker and don't want to build their own docker image.

Activity

  1. phernandez commented on Jun 20, 2025

    @phernandez
    Member

    @claude how did this image get pushed to https://hub.docker.com/r/mcp/basic-memory? We don't have any process that pushes images in our ci, do we?

  2. claude commented on Jun 20, 2025

    @claude
    Contributor

    Claude finished @phernandez's task —— View job


    Investigating Docker Image Push Process

    I've analyzed your CI/CD workflows and Docker configuration. Here are my findings:

    Todo List:

    • Examine GitHub Actions workflows for Docker-related processes
    • Look for Dockerfiles in the repository
    • Check for Docker Hub or container registry configurations
    • Investigate the current image source and publishing mechanism
    • Provide findings and recommendations

    Findings:

    Current CI/CD Workflows:

    • release.yml: Builds Python packages and publishes to PyPI + updates Homebrew formula
    • dev-release.yml: Publishes development versions to PyPI
    • test.yml: Runs tests and type checking
    • No Docker workflows found ❌

    Docker Configuration Found:

    • ✅ Dockerfile exists (Python 3.12-slim based)
    • ✅ docker-compose.yml exists with full configuration
    • ✅ docs/Docker.md contains comprehensive Docker setup documentation

    Answer to Your Question:

    You're correct - you don't have any CI process that pushes Docker images.

    The Docker image at docker.io/mcp/basic-memory showing version 0.12.3 was NOT pushed through your automated CI/CD. It must have been:

    1. Manually pushed by someone with access to the mcp Docker Hub organization
    2. Pushed through a different/older CI process that's no longer in the repository
    3. Pushed from a different repository or development setup

    Recommendations:

    To implement the feature requested in this issue, you would need to:

    1. Add a Docker workflow to .github/workflows/ that:

      • Builds the Docker image on releases
      • Pushes to docker.io/mcp/basic-memory
      • Tags with the version number
    2. Configure Docker Hub secrets in your repository:

      • DOCKER_USERNAME
      • DOCKER_PASSWORD or DOCKER_TOKEN
    3. Determine the correct Docker Hub organization - currently pushing to mcp/basic-memory but you may want basicmachines-co/basic-memory instead


  3. phernandez commented on Jun 20, 2025

    @phernandez
    Member

    Hi @madanyang thanks for reporting this issue. This is a bit confusing, because the https://hub.docker.com/r/mcp/basic-memory image was not created by us. It looks to be from a different organization: https://hub.docker.com/u/mcp.

    We have just recently created a Docker image (still in our main branch), and we haven't released it yet. Once we do, we will publish it to docker hub under our own org.

  4. phernandez commented on Jun 20, 2025

    @phernandez
    Member

    @claude can you make PR with a ci workflow to publish our Dockerfile to docker hub on release?

  5. claude commented on Jun 20, 2025

    @claude
    Contributor

    Claude finished @phernandez's task —— View job


    Docker Hub Publishing Workflow Created ✅

    I've created the CI workflow to automatically publish your Dockerfile to Docker Hub on releases.

    Todo List:

    • Examine existing Dockerfile and understand build requirements
    • Review current release workflows to understand trigger patterns
    • Create Docker workflow with build and push steps
    • Configure for basicmachines-co organization
    • Add proper tagging strategy (latest + version tags)
    • Test workflow syntax
    • Document required Docker Hub secrets for setup

    ⚠️ Manual Setup Required

    I cannot directly modify workflow files due to security permissions. Please add this Docker job to your .github/workflows/release.yml file manually:

      docker:
        name: Build and Push Docker Image
        needs: release
        runs-on: ubuntu-latest
        permissions:
          contents: read
          packages: write
        steps:
          - name: Checkout code
            uses: actions/checkout@v4
    
          - name: Set up Docker Buildx
            uses: docker/setup-buildx-action@v3
    
          - name: Log in to Docker Hub
            uses: docker/login-action@v3
            with:
              username: ${{ secrets.DOCKER_USERNAME }}
              password: ${{ secrets.DOCKER_PASSWORD }}
    
          - name: Extract version from tag
            id: version
            run: |
              # Remove 'v' prefix from tag name (e.g., v1.0.0 -> 1.0.0)
              echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
    
          - name: Build and push Docker image
            uses: docker/build-push-action@v5
            with:
              context: .
              file: ./Dockerfile
              push: true
              tags: |
                basicmachines-co/basic-memory:latest
                basicmachines-co/basic-memory:${{ steps.version.outputs.version }}
              platforms: linux/amd64,linux/arm64
              cache-from: type=gha
              cache-to: type=gha,mode=max

    Required Setup:

    1. Docker Hub Secrets
    Add these secrets to your repository settings:

    • DOCKER_USERNAME: Your Docker Hub username
    • DOCKER_PASSWORD: Your Docker Hub password or access token

    2. Docker Hub Repository
    Ensure basicmachines-co/basic-memory repository exists on Docker Hub

    Features:

    • Triggers: Automatically runs on release tags (v*)
    • Multi-platform: Builds for linux/amd64 and linux/arm64
    • Tagging: Creates both latest and version-specific tags
    • Caching: Uses GitHub Actions cache for faster builds
    • Organization: Publishes to basicmachines-co/basic-memory

    Next Steps:

    1. Add the Docker job to your release.yml file
    2. Configure the Docker Hub secrets
    3. Create the Docker Hub repository
    4. Test with your next release

  6. added this to the v0.14.0 milestone on Jun 20, 2025
  7. madanyang commented on Jun 20, 2025

    @madanyang
    Author

    Hi @madanyang thanks for reporting this issue. This is a bit confusing, because the https://hub.docker.com/r/mcp/basic-memory image was not created by us. It looks to be from a different organization: https://hub.docker.com/u/mcp.

    Had no idea @phernandez

    We have just recently created a Docker image (still in our main branch), and we haven't released it yet. Once we do, we will publish it to docker hub under our own org.

    Glad to hear thanks in advance.

  8. groksrc commented on Jun 24, 2025

    @groksrc
    Member

    @phernandez The .basic-memory/config.json isn't configured to use the mounted directory so the files mounted in /app/data don't get indexed. I ran into this while working on the bot, I think the PR probably needs a little more work.

  9. phernandez commented on Jun 24, 2025

    @phernandez
    Member

    OK, yeah @claude can you see the comment above about which file is configured for basic-memory in the Dockerfile and docker-compose.yml?

    Previously we had a multi-user Dockerfile that was overly complicated. We simplified it but this fell through the cracks. We want the main project in the ~/.basic-memory/config.json to point to the mounted volume in the docker compose file.

  10. claude commented on Jun 24, 2025

    @claude
    Contributor

    Claude finished @phernandez's task —— View job • claude/issue-153-20250624_130954 • Create PR ➔


    Docker Configuration Fixed ✅

    I've successfully fixed the Docker configuration issue where the .basic-memory/config.json wasn't configured to use the mounted directory.

    Todo List:

    • Examine current Dockerfile and docker-compose.yml
    • Analyze current configuration setup
    • Fix configuration to point to mounted volume
    • Test configuration works as expected
    • Commit changes to branch

    Analysis:

    Current Setup:

    • Dockerfile sets BASIC_MEMORY_HOME=/app/data but this is overridden by the config
    • docker-compose.yml mounts user knowledge to /app/data and config to /root/.basic-memory
    • Missing initialization step to create config.json pointing default project to /app/data

    Expected Config Format:

    {
      "projects": {
        "main": "/app/data"
      },
      "default_project": "main",
      "env": "user",
      "log_level": "INFO",
      "sync_changes": true,
      "sync_delay": 1000
    }

    Solution Implemented:

    1. Created docker-init.sh:

    • Initialization script that runs on container startup
    • Creates proper config.json pointing to mounted /app/data directory
    • Only creates config if it doesn't exist or points to wrong directory
    • Preserves existing configurations when appropriate

    2. Updated Dockerfile:

    • Added copy and setup of initialization script
    • Set script as ENTRYPOINT to run before main command
    • Maintains original CMD for basic-memory server startup

    3. Updated docker-compose.yml:

    • Clarified comments about automatic configuration initialization

    Now when the container starts, it will automatically configure the main project to use the mounted volume at /app/data, ensuring files are properly indexed.

    Changes Committed:

    • ✅ docker-init.sh - New initialization script
    • ✅ Dockerfile - Updated to use initialization script
    • ✅ docker-compose.yml - Updated comments

  11. phernandez commented on Jun 27, 2025

    @phernandez
    Member

    FYI, docker images are pushed to ghcr.io/basicmachines-co/basic-memory. @madanyang please use that image if you want to use the our official version.

  12. madanyang commented on Jun 27, 2025

    @madanyang
    Author

    FYI, docker images are pushed to ghcr.io/basicmachines-co/basic-memory. @madanyang please use that image if you want to use the our official version.

    Thanks @phernandez . Already pulled the image yet hadn't time to check it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions