Docker container with Docker and node: Not working with multi-stageHow to use multiple base images to build a docker imageHow do you prevent install of “devDependencies” NPM modules for Node.js (package.json)?How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)How is Docker different from a virtual machine?Should I use Vagrant or Docker for creating an isolated environment?How to list containers in DockerHow to remove old Docker containersCopying files from Docker container to hostCopying files from host to Docker containerHow to mount a host directory in a Docker containerNode Sass could not find a binding for your current environment

Japanese reading of an integer

Is there a way to know the composition of a Team GO Rocket before going into the fight?

(3 of 11: Akari) What is Pyramid Cult's Favorite Car?

This day in history III

Is it safe if the neutral lead is exposed and disconnected?

Struggling with cyclical dependancies in unit tests

Why didn’t Christianity spread southwards from Ethiopia in the Middle Ages?

Why does the Eurostar not show youth pricing?

Do the books ever say oliphaunts aren’t elephants?

How can religions be structured in ways that allow inter-faith councils to work?

Did Vladimir Lenin have a cat?

Dobbs Murder Mystery : A Picture worth 1000 words?

How can I kill my goat?

Telling manager project isn't worth the effort?

Did the Americans trade destroyers in the "destroyer deal" that they would later need themselves?

Why were contact sensors put on three of the Lunar Module's four legs? Did they ever bend and stick out sideways?

Why is の所 used after ドア in this sentence?

Incrementing add under condition in pandas

Composing fill in the blanks

Can I change the license of a forked project to the MIT if the license of the parent project has changed from the GPL to the MIT?

How can Paypal know my card is being used in another account?

Finding out if upgrading to a newer macOS version will cause issues?

Name These Animals

Does Wolfram Mathworld make a mistake describing a discrete probability distribution with a probability density function?



Docker container with Docker and node: Not working with multi-stage


How to use multiple base images to build a docker imageHow do you prevent install of “devDependencies” NPM modules for Node.js (package.json)?How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)How is Docker different from a virtual machine?Should I use Vagrant or Docker for creating an isolated environment?How to list containers in DockerHow to remove old Docker containersCopying files from Docker container to hostCopying files from host to Docker containerHow to mount a host directory in a Docker containerNode Sass could not find a binding for your current environment






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I would like to have a docker container for a CI-step that has docker and node installed.
I thought it would be the perfect use-case to use the multistage build.



I have a new docker version Docker version 18.09.3, build 774a1f4 and I tried this Dockerfile, but to no avail:



FROM docker:18.09.3
FROM node:8
CMD ['bash']


The resulting image has node-stuff such as npm installed, but no docker things... Any ideas how to proceed here?



Thanks a lot!



Update



I changed the Dockerfile to this, which also does not work (docker is not installed in the container):



FROM docker:18.09.3

FROM ubuntu:latest
USER root
RUN apt-get update
RUN apt-get -y install curl gnupg
RUN curl -sL https://deb.nodesource.com/setup_11.x | bash -
RUN apt-get -y install nodejs

CMD [ "node" ]


Update2
This Dockerfile does what I need, but it is not with multi-stage (which I would have liked to try here)



FROM docker:18.09.3

USER root
RUN apk update
RUN apk add --update nodejs nodejs-npm

CMD [ "node" ]









share|improve this question





















  • 1





    Possible duplicate of How to use multiple base images to build a docker image

    – David Maze
    Mar 26 at 20:06






  • 1





    You got misled in thinking that multi stage images are what you need. Multistage would help you if you want to build something based on npm, then would reuse the file of your dependencies in node_module in another image without the need to use node on the resulting image. This is the sue case.

    – b.enoit.be
    Mar 26 at 21:13











  • @b.enoit.be please write this as an answer so I can accept it.

    – konse
    Apr 11 at 12:30

















0















I would like to have a docker container for a CI-step that has docker and node installed.
I thought it would be the perfect use-case to use the multistage build.



I have a new docker version Docker version 18.09.3, build 774a1f4 and I tried this Dockerfile, but to no avail:



FROM docker:18.09.3
FROM node:8
CMD ['bash']


The resulting image has node-stuff such as npm installed, but no docker things... Any ideas how to proceed here?



Thanks a lot!



Update



I changed the Dockerfile to this, which also does not work (docker is not installed in the container):



FROM docker:18.09.3

FROM ubuntu:latest
USER root
RUN apt-get update
RUN apt-get -y install curl gnupg
RUN curl -sL https://deb.nodesource.com/setup_11.x | bash -
RUN apt-get -y install nodejs

CMD [ "node" ]


Update2
This Dockerfile does what I need, but it is not with multi-stage (which I would have liked to try here)



FROM docker:18.09.3

USER root
RUN apk update
RUN apk add --update nodejs nodejs-npm

CMD [ "node" ]









share|improve this question





















  • 1





    Possible duplicate of How to use multiple base images to build a docker image

    – David Maze
    Mar 26 at 20:06






  • 1





    You got misled in thinking that multi stage images are what you need. Multistage would help you if you want to build something based on npm, then would reuse the file of your dependencies in node_module in another image without the need to use node on the resulting image. This is the sue case.

    – b.enoit.be
    Mar 26 at 21:13











  • @b.enoit.be please write this as an answer so I can accept it.

    – konse
    Apr 11 at 12:30













0












0








0








I would like to have a docker container for a CI-step that has docker and node installed.
I thought it would be the perfect use-case to use the multistage build.



I have a new docker version Docker version 18.09.3, build 774a1f4 and I tried this Dockerfile, but to no avail:



FROM docker:18.09.3
FROM node:8
CMD ['bash']


The resulting image has node-stuff such as npm installed, but no docker things... Any ideas how to proceed here?



Thanks a lot!



Update



I changed the Dockerfile to this, which also does not work (docker is not installed in the container):



FROM docker:18.09.3

FROM ubuntu:latest
USER root
RUN apt-get update
RUN apt-get -y install curl gnupg
RUN curl -sL https://deb.nodesource.com/setup_11.x | bash -
RUN apt-get -y install nodejs

CMD [ "node" ]


Update2
This Dockerfile does what I need, but it is not with multi-stage (which I would have liked to try here)



FROM docker:18.09.3

USER root
RUN apk update
RUN apk add --update nodejs nodejs-npm

CMD [ "node" ]









share|improve this question
















I would like to have a docker container for a CI-step that has docker and node installed.
I thought it would be the perfect use-case to use the multistage build.



I have a new docker version Docker version 18.09.3, build 774a1f4 and I tried this Dockerfile, but to no avail:



FROM docker:18.09.3
FROM node:8
CMD ['bash']


The resulting image has node-stuff such as npm installed, but no docker things... Any ideas how to proceed here?



Thanks a lot!



Update



I changed the Dockerfile to this, which also does not work (docker is not installed in the container):



FROM docker:18.09.3

FROM ubuntu:latest
USER root
RUN apt-get update
RUN apt-get -y install curl gnupg
RUN curl -sL https://deb.nodesource.com/setup_11.x | bash -
RUN apt-get -y install nodejs

CMD [ "node" ]


Update2
This Dockerfile does what I need, but it is not with multi-stage (which I would have liked to try here)



FROM docker:18.09.3

USER root
RUN apk update
RUN apk add --update nodejs nodejs-npm

CMD [ "node" ]






node.js docker docker-multi-stage-build






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 26 at 20:11







konse

















asked Mar 26 at 19:22









konsekonse

1612 silver badges10 bronze badges




1612 silver badges10 bronze badges










  • 1





    Possible duplicate of How to use multiple base images to build a docker image

    – David Maze
    Mar 26 at 20:06






  • 1





    You got misled in thinking that multi stage images are what you need. Multistage would help you if you want to build something based on npm, then would reuse the file of your dependencies in node_module in another image without the need to use node on the resulting image. This is the sue case.

    – b.enoit.be
    Mar 26 at 21:13











  • @b.enoit.be please write this as an answer so I can accept it.

    – konse
    Apr 11 at 12:30












  • 1





    Possible duplicate of How to use multiple base images to build a docker image

    – David Maze
    Mar 26 at 20:06






  • 1





    You got misled in thinking that multi stage images are what you need. Multistage would help you if you want to build something based on npm, then would reuse the file of your dependencies in node_module in another image without the need to use node on the resulting image. This is the sue case.

    – b.enoit.be
    Mar 26 at 21:13











  • @b.enoit.be please write this as an answer so I can accept it.

    – konse
    Apr 11 at 12:30







1




1





Possible duplicate of How to use multiple base images to build a docker image

– David Maze
Mar 26 at 20:06





Possible duplicate of How to use multiple base images to build a docker image

– David Maze
Mar 26 at 20:06




1




1





You got misled in thinking that multi stage images are what you need. Multistage would help you if you want to build something based on npm, then would reuse the file of your dependencies in node_module in another image without the need to use node on the resulting image. This is the sue case.

– b.enoit.be
Mar 26 at 21:13





You got misled in thinking that multi stage images are what you need. Multistage would help you if you want to build something based on npm, then would reuse the file of your dependencies in node_module in another image without the need to use node on the resulting image. This is the sue case.

– b.enoit.be
Mar 26 at 21:13













@b.enoit.be please write this as an answer so I can accept it.

– konse
Apr 11 at 12:30





@b.enoit.be please write this as an answer so I can accept it.

– konse
Apr 11 at 12:30












0






active

oldest

votes










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%2f55364814%2fdocker-container-with-docker-and-node-not-working-with-multi-stage%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















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%2f55364814%2fdocker-container-with-docker-and-node-not-working-with-multi-stage%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

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript