Importing base image twice in the same dockerfileHow does one remove an image in Docker?How to generate a Dockerfile from an image?Using the RUN instruction in a Dockerfile with 'source' does not workWhat is the difference between CMD and ENTRYPOINT in a Dockerfile?How to copy Docker images from one host to another without using a repositoryWhat is the difference between the `COPY` and `ADD` commands in a Dockerfile?How to mount host volumes into docker containers in Dockerfile during buildDockerfile: understanding VOLUME instructionHow to show a dockerfile of image dockerDockerfile: ENTRYPOINT and CMD
Can I Retrieve Email Addresses from BCC?
Why Were Madagascar and New Zealand Discovered So Late?
How will losing mobility of one hand affect my career as a programmer?
Hide Select Output from T-SQL
How can I get through very long and very dry, but also very useful technical documents when learning a new tool?
I'm in charge of equipment buying but no one's ever happy with what I choose. How to fix this?
There is only s̶i̶x̶t̶y one place he can be
apt-get update is failing in debian
Minimal reference content
What will be the benefits of Brexit?
Greatest common substring
Products and sum of cubes in Fibonacci
Why "be dealt cards" rather than "be dealing cards"?
Everything Bob says is false. How does he get people to trust him?
Why did Kant, Hegel, and Adorno leave some words and phrases in the Greek alphabet?
Why are on-board computers allowed to change controls without notifying the pilots?
Should my PhD thesis be submitted under my legal name?
What is the intuitive meaning of having a linear relationship between the logs of two variables?
How do I define a right arrow with bar in LaTeX?
Go Pregnant or Go Home
Displaying the order of the columns of a table
Mapping a list into a phase plot
What is the opposite of 'gravitas'?
What are the ramifications of creating a homebrew world without an Astral Plane?
Importing base image twice in the same dockerfile
How does one remove an image in Docker?How to generate a Dockerfile from an image?Using the RUN instruction in a Dockerfile with 'source' does not workWhat is the difference between CMD and ENTRYPOINT in a Dockerfile?How to copy Docker images from one host to another without using a repositoryWhat is the difference between the `COPY` and `ADD` commands in a Dockerfile?How to mount host volumes into docker containers in Dockerfile during buildDockerfile: understanding VOLUME instructionHow to show a dockerfile of image dockerDockerfile: ENTRYPOINT and CMD
Can I use aliases for base image? For e.g. is this valid in dockerfile?
FROM some_image AS builder
I can see the use of this like...
https://github.com/gliderlabs/registrator/blob/master/Dockerfile
But I will like to know if this is officially supported syntax.
docker dockerfile
add a comment |
Can I use aliases for base image? For e.g. is this valid in dockerfile?
FROM some_image AS builder
I can see the use of this like...
https://github.com/gliderlabs/registrator/blob/master/Dockerfile
But I will like to know if this is officially supported syntax.
docker dockerfile
1
docs.docker.com/engine/reference/builder/#from has the official syntax, and theFROM ... ASversion is pretty common these days.
– David Maze
Mar 8 at 11:14
add a comment |
Can I use aliases for base image? For e.g. is this valid in dockerfile?
FROM some_image AS builder
I can see the use of this like...
https://github.com/gliderlabs/registrator/blob/master/Dockerfile
But I will like to know if this is officially supported syntax.
docker dockerfile
Can I use aliases for base image? For e.g. is this valid in dockerfile?
FROM some_image AS builder
I can see the use of this like...
https://github.com/gliderlabs/registrator/blob/master/Dockerfile
But I will like to know if this is officially supported syntax.
docker dockerfile
docker dockerfile
asked Mar 8 at 9:32
shantanuoshantanuo
12k58155263
12k58155263
1
docs.docker.com/engine/reference/builder/#from has the official syntax, and theFROM ... ASversion is pretty common these days.
– David Maze
Mar 8 at 11:14
add a comment |
1
docs.docker.com/engine/reference/builder/#from has the official syntax, and theFROM ... ASversion is pretty common these days.
– David Maze
Mar 8 at 11:14
1
1
docs.docker.com/engine/reference/builder/#from has the official syntax, and the
FROM ... AS version is pretty common these days.– David Maze
Mar 8 at 11:14
docs.docker.com/engine/reference/builder/#from has the official syntax, and the
FROM ... AS version is pretty common these days.– David Maze
Mar 8 at 11:14
add a comment |
1 Answer
1
active
oldest
votes
Yes, its officially supported by docker and termed as multistage builder. It will help to reduce the docker image size considerably.
It can help, if used correctly.
– AKX
Mar 8 at 11:14
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55060305%2fimporting-base-image-twice-in-the-same-dockerfile%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
Yes, its officially supported by docker and termed as multistage builder. It will help to reduce the docker image size considerably.
It can help, if used correctly.
– AKX
Mar 8 at 11:14
add a comment |
Yes, its officially supported by docker and termed as multistage builder. It will help to reduce the docker image size considerably.
It can help, if used correctly.
– AKX
Mar 8 at 11:14
add a comment |
Yes, its officially supported by docker and termed as multistage builder. It will help to reduce the docker image size considerably.
Yes, its officially supported by docker and termed as multistage builder. It will help to reduce the docker image size considerably.
answered Mar 8 at 11:13
Aakash SharmaAakash Sharma
1483
1483
It can help, if used correctly.
– AKX
Mar 8 at 11:14
add a comment |
It can help, if used correctly.
– AKX
Mar 8 at 11:14
It can help, if used correctly.
– AKX
Mar 8 at 11:14
It can help, if used correctly.
– AKX
Mar 8 at 11:14
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55060305%2fimporting-base-image-twice-in-the-same-dockerfile%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
docs.docker.com/engine/reference/builder/#from has the official syntax, and the
FROM ... ASversion is pretty common these days.– David Maze
Mar 8 at 11:14