Multiline comments in Dockerfiles Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Docker updating image along when dockerfile changesUsing the RUN instruction in a Dockerfile with 'source' does not workWhat is the difference between CMD and ENTRYPOINT in a Dockerfile?Clone private git repo with dockerfileWhat is the difference between the `COPY` and `ADD` commands in a Dockerfile?How to write commands with multiple lines in Dockerfile while preserving the new lines?How do I make a comment in a Dockerfile?Multiple RUN vs. single chained RUN in Dockerfile, what is better?Creating bash script from Dockerfile strips commentsHow to specify working directory for ENTRYPOINT in Dockerfile
How to align enumerate environment inside description environment
Printing attributes of selection in ArcPy?
Is it dangerous to install hacking tools on my private linux machine?
Simple Http Server
How can I prevent/balance waiting and turtling as a response to cooldown mechanics
What would you call this weird metallic apparatus that allows you to lift people?
Sally's older brother
Special flights
Flight departed from the gate 5 min before scheduled departure time. Refund options
Why not send Voyager 3 and 4 following up the paths taken by Voyager 1 and 2 to re-transmit signals of later as they fly away from Earth?
What initially awakened the Balrog?
Why complex landing gears are used instead of simple,reliability and light weight muscle wire or shape memory alloys?
How to ask rejected full-time candidates to apply to teach individual courses?
Central Vacuuming: Is it worth it, and how does it compare to normal vacuuming?
Is multiple magic items in one inherently imbalanced?
Can an iPhone 7 be made to function as a NFC Tag?
Why weren't discrete x86 CPUs ever used in game hardware?
White walkers, cemeteries and wights
Mounting TV on a weird wall that has some material between the drywall and stud
Was Kant an Intuitionist about mathematical objects?
How to change the tick of the color bar legend to black
Can two people see the same photon?
How many time has Arya actually used Needle?
If Windows 7 doesn't support WSL, then what is "Subsystem for UNIX-based Applications"?
Multiline comments in Dockerfiles
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!Docker updating image along when dockerfile changesUsing the RUN instruction in a Dockerfile with 'source' does not workWhat is the difference between CMD and ENTRYPOINT in a Dockerfile?Clone private git repo with dockerfileWhat is the difference between the `COPY` and `ADD` commands in a Dockerfile?How to write commands with multiple lines in Dockerfile while preserving the new lines?How do I make a comment in a Dockerfile?Multiple RUN vs. single chained RUN in Dockerfile, what is better?Creating bash script from Dockerfile strips commentsHow to specify working directory for ENTRYPOINT in Dockerfile
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
Is there a fast way to comment out multiple lines in a Dockerfile?
I know that I can add #
at the beginning of each line. But if there are many lines this is too much work. In some languages there are multiline comments such as /* ... */
, which makes commenting out large parts of a file very fast.
docker dockerfile
add a comment |
Is there a fast way to comment out multiple lines in a Dockerfile?
I know that I can add #
at the beginning of each line. But if there are many lines this is too much work. In some languages there are multiline comments such as /* ... */
, which makes commenting out large parts of a file very fast.
docker dockerfile
M-x comment-region
will work in Emacs;.,.+4s/^/# /
will comment out the next five lines in vi.
– David Maze
Mar 14 at 15:17
Any modern IDE will allow you to select lines with mouse and do a simple control + / to comment all of them
– Pitto
Mar 14 at 15:19
Some community editions of JetBrains' IDE do not recognize Dockerfiles. To still be able to use the control + / shortcut, create a new file type, set "Line comment" to "#" and associate your Dockerfile with the newly created file type.
– user1460043
Mar 21 at 10:29
add a comment |
Is there a fast way to comment out multiple lines in a Dockerfile?
I know that I can add #
at the beginning of each line. But if there are many lines this is too much work. In some languages there are multiline comments such as /* ... */
, which makes commenting out large parts of a file very fast.
docker dockerfile
Is there a fast way to comment out multiple lines in a Dockerfile?
I know that I can add #
at the beginning of each line. But if there are many lines this is too much work. In some languages there are multiline comments such as /* ... */
, which makes commenting out large parts of a file very fast.
docker dockerfile
docker dockerfile
asked Mar 14 at 15:10
user1460043user1460043
945716
945716
M-x comment-region
will work in Emacs;.,.+4s/^/# /
will comment out the next five lines in vi.
– David Maze
Mar 14 at 15:17
Any modern IDE will allow you to select lines with mouse and do a simple control + / to comment all of them
– Pitto
Mar 14 at 15:19
Some community editions of JetBrains' IDE do not recognize Dockerfiles. To still be able to use the control + / shortcut, create a new file type, set "Line comment" to "#" and associate your Dockerfile with the newly created file type.
– user1460043
Mar 21 at 10:29
add a comment |
M-x comment-region
will work in Emacs;.,.+4s/^/# /
will comment out the next five lines in vi.
– David Maze
Mar 14 at 15:17
Any modern IDE will allow you to select lines with mouse and do a simple control + / to comment all of them
– Pitto
Mar 14 at 15:19
Some community editions of JetBrains' IDE do not recognize Dockerfiles. To still be able to use the control + / shortcut, create a new file type, set "Line comment" to "#" and associate your Dockerfile with the newly created file type.
– user1460043
Mar 21 at 10:29
M-x comment-region
will work in Emacs; .,.+4s/^/# /
will comment out the next five lines in vi.– David Maze
Mar 14 at 15:17
M-x comment-region
will work in Emacs; .,.+4s/^/# /
will comment out the next five lines in vi.– David Maze
Mar 14 at 15:17
Any modern IDE will allow you to select lines with mouse and do a simple control + / to comment all of them
– Pitto
Mar 14 at 15:19
Any modern IDE will allow you to select lines with mouse and do a simple control + / to comment all of them
– Pitto
Mar 14 at 15:19
Some community editions of JetBrains' IDE do not recognize Dockerfiles. To still be able to use the control + / shortcut, create a new file type, set "Line comment" to "#" and associate your Dockerfile with the newly created file type.
– user1460043
Mar 21 at 10:29
Some community editions of JetBrains' IDE do not recognize Dockerfiles. To still be able to use the control + / shortcut, create a new file type, set "Line comment" to "#" and associate your Dockerfile with the newly created file type.
– user1460043
Mar 21 at 10:29
add a comment |
2 Answers
2
active
oldest
votes
As of today, no.
According to Dockerfile reference documentation:
Docker treats lines that begin with # as a comment, unless the line is
a valid parser directive. A # marker anywhere else in a line is
treated as an argument.:
There is no further details on how to comment lines.
As said by some comments already, most IDE will allow you to perform multiline comments easily (such as CTRL + /
on IntelliJ)
add a comment |
There is no mentioning of multiline comments in Docker documentation
I also paste here the relevant part for simplicity:
Docker treats lines that begin with # as a comment, unless the line is
a valid parser directive. A # marker anywhere else in a line is
treated as an argument. This allows statements like:
# Comment
RUN echo 'we are running some # of cool things'
Line continuation characters are not supported in comments.
On the other hand you can achieve the requested result easily with any modern IDE / Text Editor.
This is an example using Sublime Text (Select text and then control + /).
You can achieve the same result with VsCode, Notepad++, JetBrains products (IntelliJ, PyCharm, PHPStorm etc.) and almost 100% of the IDEs / Text Editors I know and use.
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%2f55165989%2fmultiline-comments-in-dockerfiles%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
As of today, no.
According to Dockerfile reference documentation:
Docker treats lines that begin with # as a comment, unless the line is
a valid parser directive. A # marker anywhere else in a line is
treated as an argument.:
There is no further details on how to comment lines.
As said by some comments already, most IDE will allow you to perform multiline comments easily (such as CTRL + /
on IntelliJ)
add a comment |
As of today, no.
According to Dockerfile reference documentation:
Docker treats lines that begin with # as a comment, unless the line is
a valid parser directive. A # marker anywhere else in a line is
treated as an argument.:
There is no further details on how to comment lines.
As said by some comments already, most IDE will allow you to perform multiline comments easily (such as CTRL + /
on IntelliJ)
add a comment |
As of today, no.
According to Dockerfile reference documentation:
Docker treats lines that begin with # as a comment, unless the line is
a valid parser directive. A # marker anywhere else in a line is
treated as an argument.:
There is no further details on how to comment lines.
As said by some comments already, most IDE will allow you to perform multiline comments easily (such as CTRL + /
on IntelliJ)
As of today, no.
According to Dockerfile reference documentation:
Docker treats lines that begin with # as a comment, unless the line is
a valid parser directive. A # marker anywhere else in a line is
treated as an argument.:
There is no further details on how to comment lines.
As said by some comments already, most IDE will allow you to perform multiline comments easily (such as CTRL + /
on IntelliJ)
answered Mar 14 at 15:27
Pierre B.Pierre B.
2,29011127
2,29011127
add a comment |
add a comment |
There is no mentioning of multiline comments in Docker documentation
I also paste here the relevant part for simplicity:
Docker treats lines that begin with # as a comment, unless the line is
a valid parser directive. A # marker anywhere else in a line is
treated as an argument. This allows statements like:
# Comment
RUN echo 'we are running some # of cool things'
Line continuation characters are not supported in comments.
On the other hand you can achieve the requested result easily with any modern IDE / Text Editor.
This is an example using Sublime Text (Select text and then control + /).
You can achieve the same result with VsCode, Notepad++, JetBrains products (IntelliJ, PyCharm, PHPStorm etc.) and almost 100% of the IDEs / Text Editors I know and use.
add a comment |
There is no mentioning of multiline comments in Docker documentation
I also paste here the relevant part for simplicity:
Docker treats lines that begin with # as a comment, unless the line is
a valid parser directive. A # marker anywhere else in a line is
treated as an argument. This allows statements like:
# Comment
RUN echo 'we are running some # of cool things'
Line continuation characters are not supported in comments.
On the other hand you can achieve the requested result easily with any modern IDE / Text Editor.
This is an example using Sublime Text (Select text and then control + /).
You can achieve the same result with VsCode, Notepad++, JetBrains products (IntelliJ, PyCharm, PHPStorm etc.) and almost 100% of the IDEs / Text Editors I know and use.
add a comment |
There is no mentioning of multiline comments in Docker documentation
I also paste here the relevant part for simplicity:
Docker treats lines that begin with # as a comment, unless the line is
a valid parser directive. A # marker anywhere else in a line is
treated as an argument. This allows statements like:
# Comment
RUN echo 'we are running some # of cool things'
Line continuation characters are not supported in comments.
On the other hand you can achieve the requested result easily with any modern IDE / Text Editor.
This is an example using Sublime Text (Select text and then control + /).
You can achieve the same result with VsCode, Notepad++, JetBrains products (IntelliJ, PyCharm, PHPStorm etc.) and almost 100% of the IDEs / Text Editors I know and use.
There is no mentioning of multiline comments in Docker documentation
I also paste here the relevant part for simplicity:
Docker treats lines that begin with # as a comment, unless the line is
a valid parser directive. A # marker anywhere else in a line is
treated as an argument. This allows statements like:
# Comment
RUN echo 'we are running some # of cool things'
Line continuation characters are not supported in comments.
On the other hand you can achieve the requested result easily with any modern IDE / Text Editor.
This is an example using Sublime Text (Select text and then control + /).
You can achieve the same result with VsCode, Notepad++, JetBrains products (IntelliJ, PyCharm, PHPStorm etc.) and almost 100% of the IDEs / Text Editors I know and use.
edited Mar 22 at 11:56
answered Mar 14 at 15:23
PittoPitto
1,93911726
1,93911726
add a comment |
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%2f55165989%2fmultiline-comments-in-dockerfiles%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
M-x comment-region
will work in Emacs;.,.+4s/^/# /
will comment out the next five lines in vi.– David Maze
Mar 14 at 15:17
Any modern IDE will allow you to select lines with mouse and do a simple control + / to comment all of them
– Pitto
Mar 14 at 15:19
Some community editions of JetBrains' IDE do not recognize Dockerfiles. To still be able to use the control + / shortcut, create a new file type, set "Line comment" to "#" and associate your Dockerfile with the newly created file type.
– user1460043
Mar 21 at 10:29