Docker is making extra images










0















When i run my docker-compose up -d command it runs all cool buuut it creates a lot of images i dont know if this should be a normal behavior but it looks like this



Status: Downloaded newer image for node:11.1.0
---> 4e4c445311e6
Step 2/8 : RUN mkdir /usr/src/app
---> Running in 3b78051548b7
Removing intermediate container 3b78051548b7
---> 96e53f58ca4a
Step 3/8 : WORKDIR /usr/src/app
---> Running in 6c09aca5e321
Removing intermediate container 6c09aca5e321
---> a392a2bdd279
Step 4/8 : ENV PATH /usr/src/app/node_modules/.bin:$PATH
---> Running in 9443cc34dc2a
Removing intermediate container 9443cc34dc2a
---> 6ba4c2ed0014


As you can see it makes a new image each step



Here you can see the list of the images made by the command



somethinghere_somethinghere latest 4163a2ac78cc 14 minutes ago 1.23GB
<none> <none> 2af2d216914a 14 minutes ago 1.23GB
<none> <none> 2471e3d94378 15 minutes ago 1.11GB
<none> <none> 6ba4c2ed0014 15 minutes ago 894MB
<none> <none> 71141d30cec8 15 minutes ago 894MB
<none> <none> a392a2bdd279 15 minutes ago 894MB
<none> <none> 96e53f58ca4a 15 minutes ago 894MB


Here ill show you my docker-compose and dockerfile



Dockerfile



# base image
FROM node:11.1.0

# set working directory
RUN mkdir /usr/src/app
WORKDIR /usr/src/app

# add `/usr/src/app/node_modules/.bin` to $PATH
ENV PATH /usr/src/app/node_modules/.bin:$PATH

# install and cache app dependencies
COPY package.json /usr/src/app/package.json
RUN npm install --silent
RUN npm install react-scripts@1.1.1 -g --silent

# start app
CMD ["npm", "start"]


docker-compose



version: '3.5'

services:

somethinghere:
container_name: somethinghere-client
build:
context: .
dockerfile: Dockerfile
volumes:
- '.:/usr/src/app'
- '/usr/src/app/node_modules'
ports:
- '3000:3000'
environment:
- NODE_ENV=development









share|improve this question

















  • 1





    Possible duplicate of Many <none> images created after build a docker image

    – David Maze
    Nov 16 '18 at 0:45






  • 1





    The short answer is "don't use the -a option to docker images, it shows you details you usually don't care about".

    – David Maze
    Nov 16 '18 at 0:46















0















When i run my docker-compose up -d command it runs all cool buuut it creates a lot of images i dont know if this should be a normal behavior but it looks like this



Status: Downloaded newer image for node:11.1.0
---> 4e4c445311e6
Step 2/8 : RUN mkdir /usr/src/app
---> Running in 3b78051548b7
Removing intermediate container 3b78051548b7
---> 96e53f58ca4a
Step 3/8 : WORKDIR /usr/src/app
---> Running in 6c09aca5e321
Removing intermediate container 6c09aca5e321
---> a392a2bdd279
Step 4/8 : ENV PATH /usr/src/app/node_modules/.bin:$PATH
---> Running in 9443cc34dc2a
Removing intermediate container 9443cc34dc2a
---> 6ba4c2ed0014


As you can see it makes a new image each step



Here you can see the list of the images made by the command



somethinghere_somethinghere latest 4163a2ac78cc 14 minutes ago 1.23GB
<none> <none> 2af2d216914a 14 minutes ago 1.23GB
<none> <none> 2471e3d94378 15 minutes ago 1.11GB
<none> <none> 6ba4c2ed0014 15 minutes ago 894MB
<none> <none> 71141d30cec8 15 minutes ago 894MB
<none> <none> a392a2bdd279 15 minutes ago 894MB
<none> <none> 96e53f58ca4a 15 minutes ago 894MB


Here ill show you my docker-compose and dockerfile



Dockerfile



# base image
FROM node:11.1.0

# set working directory
RUN mkdir /usr/src/app
WORKDIR /usr/src/app

# add `/usr/src/app/node_modules/.bin` to $PATH
ENV PATH /usr/src/app/node_modules/.bin:$PATH

# install and cache app dependencies
COPY package.json /usr/src/app/package.json
RUN npm install --silent
RUN npm install react-scripts@1.1.1 -g --silent

# start app
CMD ["npm", "start"]


docker-compose



version: '3.5'

services:

somethinghere:
container_name: somethinghere-client
build:
context: .
dockerfile: Dockerfile
volumes:
- '.:/usr/src/app'
- '/usr/src/app/node_modules'
ports:
- '3000:3000'
environment:
- NODE_ENV=development









share|improve this question

















  • 1





    Possible duplicate of Many <none> images created after build a docker image

    – David Maze
    Nov 16 '18 at 0:45






  • 1





    The short answer is "don't use the -a option to docker images, it shows you details you usually don't care about".

    – David Maze
    Nov 16 '18 at 0:46













0












0








0








When i run my docker-compose up -d command it runs all cool buuut it creates a lot of images i dont know if this should be a normal behavior but it looks like this



Status: Downloaded newer image for node:11.1.0
---> 4e4c445311e6
Step 2/8 : RUN mkdir /usr/src/app
---> Running in 3b78051548b7
Removing intermediate container 3b78051548b7
---> 96e53f58ca4a
Step 3/8 : WORKDIR /usr/src/app
---> Running in 6c09aca5e321
Removing intermediate container 6c09aca5e321
---> a392a2bdd279
Step 4/8 : ENV PATH /usr/src/app/node_modules/.bin:$PATH
---> Running in 9443cc34dc2a
Removing intermediate container 9443cc34dc2a
---> 6ba4c2ed0014


As you can see it makes a new image each step



Here you can see the list of the images made by the command



somethinghere_somethinghere latest 4163a2ac78cc 14 minutes ago 1.23GB
<none> <none> 2af2d216914a 14 minutes ago 1.23GB
<none> <none> 2471e3d94378 15 minutes ago 1.11GB
<none> <none> 6ba4c2ed0014 15 minutes ago 894MB
<none> <none> 71141d30cec8 15 minutes ago 894MB
<none> <none> a392a2bdd279 15 minutes ago 894MB
<none> <none> 96e53f58ca4a 15 minutes ago 894MB


Here ill show you my docker-compose and dockerfile



Dockerfile



# base image
FROM node:11.1.0

# set working directory
RUN mkdir /usr/src/app
WORKDIR /usr/src/app

# add `/usr/src/app/node_modules/.bin` to $PATH
ENV PATH /usr/src/app/node_modules/.bin:$PATH

# install and cache app dependencies
COPY package.json /usr/src/app/package.json
RUN npm install --silent
RUN npm install react-scripts@1.1.1 -g --silent

# start app
CMD ["npm", "start"]


docker-compose



version: '3.5'

services:

somethinghere:
container_name: somethinghere-client
build:
context: .
dockerfile: Dockerfile
volumes:
- '.:/usr/src/app'
- '/usr/src/app/node_modules'
ports:
- '3000:3000'
environment:
- NODE_ENV=development









share|improve this question














When i run my docker-compose up -d command it runs all cool buuut it creates a lot of images i dont know if this should be a normal behavior but it looks like this



Status: Downloaded newer image for node:11.1.0
---> 4e4c445311e6
Step 2/8 : RUN mkdir /usr/src/app
---> Running in 3b78051548b7
Removing intermediate container 3b78051548b7
---> 96e53f58ca4a
Step 3/8 : WORKDIR /usr/src/app
---> Running in 6c09aca5e321
Removing intermediate container 6c09aca5e321
---> a392a2bdd279
Step 4/8 : ENV PATH /usr/src/app/node_modules/.bin:$PATH
---> Running in 9443cc34dc2a
Removing intermediate container 9443cc34dc2a
---> 6ba4c2ed0014


As you can see it makes a new image each step



Here you can see the list of the images made by the command



somethinghere_somethinghere latest 4163a2ac78cc 14 minutes ago 1.23GB
<none> <none> 2af2d216914a 14 minutes ago 1.23GB
<none> <none> 2471e3d94378 15 minutes ago 1.11GB
<none> <none> 6ba4c2ed0014 15 minutes ago 894MB
<none> <none> 71141d30cec8 15 minutes ago 894MB
<none> <none> a392a2bdd279 15 minutes ago 894MB
<none> <none> 96e53f58ca4a 15 minutes ago 894MB


Here ill show you my docker-compose and dockerfile



Dockerfile



# base image
FROM node:11.1.0

# set working directory
RUN mkdir /usr/src/app
WORKDIR /usr/src/app

# add `/usr/src/app/node_modules/.bin` to $PATH
ENV PATH /usr/src/app/node_modules/.bin:$PATH

# install and cache app dependencies
COPY package.json /usr/src/app/package.json
RUN npm install --silent
RUN npm install react-scripts@1.1.1 -g --silent

# start app
CMD ["npm", "start"]


docker-compose



version: '3.5'

services:

somethinghere:
container_name: somethinghere-client
build:
context: .
dockerfile: Dockerfile
volumes:
- '.:/usr/src/app'
- '/usr/src/app/node_modules'
ports:
- '3000:3000'
environment:
- NODE_ENV=development






docker






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 16 '18 at 0:00









Jose RamonJose Ramon

479




479







  • 1





    Possible duplicate of Many <none> images created after build a docker image

    – David Maze
    Nov 16 '18 at 0:45






  • 1





    The short answer is "don't use the -a option to docker images, it shows you details you usually don't care about".

    – David Maze
    Nov 16 '18 at 0:46












  • 1





    Possible duplicate of Many <none> images created after build a docker image

    – David Maze
    Nov 16 '18 at 0:45






  • 1





    The short answer is "don't use the -a option to docker images, it shows you details you usually don't care about".

    – David Maze
    Nov 16 '18 at 0:46







1




1





Possible duplicate of Many <none> images created after build a docker image

– David Maze
Nov 16 '18 at 0:45





Possible duplicate of Many <none> images created after build a docker image

– David Maze
Nov 16 '18 at 0:45




1




1





The short answer is "don't use the -a option to docker images, it shows you details you usually don't care about".

– David Maze
Nov 16 '18 at 0:46





The short answer is "don't use the -a option to docker images, it shows you details you usually don't care about".

– David Maze
Nov 16 '18 at 0:46












1 Answer
1






active

oldest

votes


















1














That's docker's caching mechanism working, they help the system to build faster if there are minor changes in the dockerfile.



As you can see in the build output,



Step 2/8 : RUN mkdir /usr/src/app
---> Running in 3b78051548b7
Removing intermediate container 3b78051548b7
---> 96e53f58ca4a


Creates a layer with the image 96e53f58ca4a.



Normally you won't need to worry about them, just use docker images and you won't see them.



More reading here






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53329546%2fdocker-is-making-extra-images%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    That's docker's caching mechanism working, they help the system to build faster if there are minor changes in the dockerfile.



    As you can see in the build output,



    Step 2/8 : RUN mkdir /usr/src/app
    ---> Running in 3b78051548b7
    Removing intermediate container 3b78051548b7
    ---> 96e53f58ca4a


    Creates a layer with the image 96e53f58ca4a.



    Normally you won't need to worry about them, just use docker images and you won't see them.



    More reading here






    share|improve this answer



























      1














      That's docker's caching mechanism working, they help the system to build faster if there are minor changes in the dockerfile.



      As you can see in the build output,



      Step 2/8 : RUN mkdir /usr/src/app
      ---> Running in 3b78051548b7
      Removing intermediate container 3b78051548b7
      ---> 96e53f58ca4a


      Creates a layer with the image 96e53f58ca4a.



      Normally you won't need to worry about them, just use docker images and you won't see them.



      More reading here






      share|improve this answer

























        1












        1








        1







        That's docker's caching mechanism working, they help the system to build faster if there are minor changes in the dockerfile.



        As you can see in the build output,



        Step 2/8 : RUN mkdir /usr/src/app
        ---> Running in 3b78051548b7
        Removing intermediate container 3b78051548b7
        ---> 96e53f58ca4a


        Creates a layer with the image 96e53f58ca4a.



        Normally you won't need to worry about them, just use docker images and you won't see them.



        More reading here






        share|improve this answer













        That's docker's caching mechanism working, they help the system to build faster if there are minor changes in the dockerfile.



        As you can see in the build output,



        Step 2/8 : RUN mkdir /usr/src/app
        ---> Running in 3b78051548b7
        Removing intermediate container 3b78051548b7
        ---> 96e53f58ca4a


        Creates a layer with the image 96e53f58ca4a.



        Normally you won't need to worry about them, just use docker images and you won't see them.



        More reading here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 16 '18 at 0:28









        SiyuSiyu

        3,06411231




        3,06411231





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53329546%2fdocker-is-making-extra-images%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Top Tejano songwriter Luis Silva dead of heart attack at 64

            ReactJS Fetched API data displays live - need Data displayed static

            政党