Currently Available: Need a skilled Software Developer for your next project?
Categories
Docker Laravel

The :latest Docker Tag and Potential Issues in Laravel Sail Setups

Using the :latest tag for Docker images in Laravel Sail can cause unexpected problems due to how Docker handles image caching. This post outlines common issues and solutions when working with tags like getmeili/meilisearch:latest.

Issue 1: Outdated Local Images

When Docker finds a locally cached image with the :latest tag, it uses that image without checking for newer versions from Docker Hub. This can result in running outdated software despite specifying :latest in your configuration.

Solution: Explicitly pull the current version of the image:

sail pull meilisearch

After pulling the new image, you need to restart the service:

sail stop meilisearch
sail rm meilisearch
sail up -d

You can verify the version update with:

sail exec meilisearch meilisearch --version

Issue 2: Docker Volume Compatibility After Version Updates

Major version updates often result in incompatibility with existing Docker volumes. In our Meilisearch example, updating from version 1.4.2 to 1.14.0 caused this error:

ERROR meilisearch: error=Your database version (1.4.2) is incompatible with your current engine version (1.14.0).

Solutions:

  1. Remove Existing Volume (For Non-Critical Data):

    • Stop all services: sail down
    • Remove the specific volume: docker volume rm [project-name]_sail-meilisearch
    • Restart services: sail up -d

    This removes all persistent data stored by the service and allows it to create a fresh volume compatible with the new version.

  2. Data Migration (For Critical Data):

    • Follow the specific service's migration documentation
    • Different services have different migration procedures

Best Practices

  • Avoid :latest: Use specific version tags (e.g., getmeili/meilisearch:v1.7.0) for stability
What I'm building

Delegate tasks. Get software.

Give Vroni a GitHub issue, bug report, spec, or rough idea. It reads the repo, plans the change, writes code, runs checks, and works toward a review-ready pull request.

Take a look at vroni.com

Subscribe to my newsletter

Get new posts when I publish them.

I respect your privacy. Unsubscribe at any time.

Leave a Reply

Your email address will not be published. Required fields are marked *