Docker Community Forums

Share and learn in the Docker community.

Docker-compose build can't find local image


(Marc) #1

When I run “docker-compose build” it understands the dependency of one service on another, and first builds the dependent image. But when it builds the (umm indendent??) image, I get the error:

ERROR: Service ‘mariadb’ failed to build: Error: image rp/centos71base not found

Even though “docker images” shows:

$ docker images
REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE
rp/centos71base         latest              21157d4fca32        22 minutes ago      539.7 MB
centos                  7.1.1503            30e55721fefe        4 months ago        212.1 MB

How can I tell it to check local images?

My docker-compose.yml contains:

services:
    centos71base:
        build: centos71base_centos
        image: rp/centos71base
    mariadb:
        build: mariadb_centos71base
        depends_on:
            - centos71base

My mariadb Dockerfile begins with:

FROM rp/centos71base:latest

Any ideas why it’s not grabbing my local image?


(crozierm) #2

You don’t use “image” and “build” at the same time. I think you only want “build:”, and “FROM rp/centos71base” in the centos71base/Dockerfile.