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













0















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.










share|improve this question

















  • 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















0















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.










share|improve this question

















  • 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













0












0








0








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.










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 8 at 9:32









shantanuoshantanuo

12k58155263




12k58155263







  • 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












  • 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







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












1 Answer
1






active

oldest

votes


















1














Yes, its officially supported by docker and termed as multistage builder. It will help to reduce the docker image size considerably.






share|improve this answer























  • It can help, if used correctly.

    – AKX
    Mar 8 at 11:14










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%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









1














Yes, its officially supported by docker and termed as multistage builder. It will help to reduce the docker image size considerably.






share|improve this answer























  • It can help, if used correctly.

    – AKX
    Mar 8 at 11:14















1














Yes, its officially supported by docker and termed as multistage builder. It will help to reduce the docker image size considerably.






share|improve this answer























  • It can help, if used correctly.

    – AKX
    Mar 8 at 11:14













1












1








1







Yes, its officially supported by docker and termed as multistage builder. It will help to reduce the docker image size considerably.






share|improve this answer













Yes, its officially supported by docker and termed as multistage builder. It will help to reduce the docker image size considerably.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 8 at 11:13









Aakash SharmaAakash Sharma

1483




1483












  • 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





It can help, if used correctly.

– AKX
Mar 8 at 11:14



















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%2f55060305%2fimporting-base-image-twice-in-the-same-dockerfile%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

How to get text form Clipboard with JavaScript in Firefox 56?How to validate an email address in JavaScript?How do JavaScript closures work?How do I remove a property from a JavaScript object?How do you get a timestamp in JavaScript?How do I copy to the clipboard in JavaScript?How do I include a JavaScript file in another JavaScript file?Get the current URL with JavaScript?How to replace all occurrences of a string in JavaScriptHow to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?

Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

List of MPs elected to the English parliament in 1640 (April) Contents List of constituencies and members See also Notes References Navigation menueNational Archives – The Glynde Place ArchivesCobbett's Parliamentary history of England, from the Norman Conquest in 1066 to the year 1803'Aldermen in Parliament', The Aldermen of the City of London: Temp. Henry III – 1912onepage&q&f&#61, false 229