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

Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

Zrinski family tree See also Navigation menu