Docker Community Forums

Share and learn in the Docker community.

Dockerfile creating extra images

I am trying to create a small docker container to use for learning Scheme. I copied a Dockerfile based on an alpine image and built it on my local computer.
After building it I see extra, untagged images when I do a docker image ls -a

The image came from

its contents are:


RUN cd /tmp \
    && apk --no-cache --update --virtual build-dependencies add build-base m4 \
    && rm -f /var/cache/apk/* \
    && wget${SCHEME_VERSION}/mit-scheme-${SCHEME_VERSION}-x86-64.tar.gz \
    && tar zxvf mit-scheme-${SCHEME_VERSION}-x86-64.tar.gz \
    && rm mit-scheme-${SCHEME_VERSION}-x86-64.tar.gz \
    && cd mit-scheme-${SCHEME_VERSION}/src \
    && ./configure \
    && make compile-microcode \
    && make install \
    && cd /tmp \
    && rm -rf cd mit-scheme-${SCHEME_VERSION} \
    && apk del build-dependencies

ENTRYPOINT ["scheme"]

Why is this creating extra images? I am building by saying:
docker build --tag=hjw-scheme .

Hi :slight_smile:

These are the layers of your image.
Check this out:

Does it matter that the none:none image layer has a size? The one in the article has a size of zero.
Here’s what my docker image ls -a tells me:

REPOSITORY    TAG                 IMAGE ID            CREATED              SIZE
<none>       <none>        6d9f79913891        28 seconds ago       78.5MB
hjw-scheme   latest        c0384c26995f        28 seconds ago       78.5MB
<none>       <none>        94f0e649396e        About a minute ago   5.53MB
alpine      latest         5cb3aa00f899        3 weeks ago          5.53MB

No this is normal.
Fx. if the first thing you do in your dockerfile, is to copy in a 1gb file, then the layers after that, will also be 1gb + the things you add afterwards in your dockerfile :slight_smile:

question deleted. I may have figured it out.

1 Like