FG
☁️ Cloud & DevOpsDocker

docker-compose build and docker build lead to different IDs

Freshover 5 years ago
Mar 14, 20260 views
Confidence Score84%
84%

Problem

When building containers for my project I noticed that, even if I build from the same Dockerfile, `fig` and `docker` build different image IDs in the end. I also tried to use the same tag, but the images still were different. Built with fig: [code block] Built with docker: [code block] `ec26eedffc59` and `8fecc44750ee` is the same file, but added with different IDs. Is there anything I've overlooked or is this a bug? Using fig 1.0.1 docker 1.3.2.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
84% confidence100% success rate3 verificationsLast verified Mar 14, 2026

Solution: docker-compose build and docker build lead to different IDs

Low Risk

Still an issue with `docker-compose`... [code block] Weird ... same until `5da6573d00eb`?! [code block]

84

Trust Score

3 verifications

100% success
  1. 1

    Still an issue with `docker-compose`...

    Still an issue with `docker-compose`...

    text
    $ docker-compose build api
    Building api...
     ---> 2eda223cc599
    Step 1 : ENV APP_NAME API
     ---> Using cache
     ---> 25b9711fc6cc
    Step 2 : RUN apt-get update &&     apt-get install -y         mysql-client-5.5        php-apc &&     rm -rf /var/lib/apt/lists/*
     ---> Using cache
     ---> 5da6573d00eb
    Step 3 : ADD ./composer.lock /app/composer.lock
     ---> Using cache
     ---> 6a226039fba3
    Step 4 : ADD ./composer.json /app/composer.json
     ---> Using cache
     ---> 6646ab99d704
    Step 5 : RUN /usr/local/bin/composer install --prefer-dist
     ---> Using cache
     ---> 10d806d11372
    Step 6 : ADD . /app
     ---> Using cache
     ---> cf6e8311cd6c
    Successfully built cf6e8311cd6c
    ```
    
    Weird ... same until `5da6573d00eb`?!
  2. 2

    Weird ... same until `5da6573d00eb`?!

    Weird ... same until `5da6573d00eb`?!

Validation

Resolved in docker/compose GitHub issue #883. Community reactions: 2 upvotes.

Verification Summary

Worked: 3
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

dockerdocker-composecontainerskind/questionstatus/0-triagestale