13

I came through the following question:

How to set image name in Dockerfile?

It clearly asks for settings image name in Dockerfile.

The first answer completely answers the question, however, the second one doesn't seem to answer the question:

How to build an image with custom name without using yml file:

docker build -t image_name . 

How to run a container with custom name:

docker run -d --name container_name image_name

There's an upvoted comment, which tells:

I've come back to this a couple times, and this answer has helped, despite being technically off-topic

Both the comment and the upvotes on the answer indicate that the answer is really being helpful.

It could be that people who look for "how to build a Docker image" reaches this question, which is irrelevant, but the answer is helpful.

It didn't feel right to me to flag it, neither to downvote. What do you think should be done here?

36
  • 3
    I doubt there's much that can be done now beyond the comments acknowledging the nature of the answer.
    – BoltClock
    Jan 9, 2018 at 5:48
  • 7
    Also, I found this deleted comment by the answerer: "for some applications it is. Its good to have comprehensive answers under a topic." Which seems absurd of course. A question about how to do something specific in a Dockerfile isn't an invitation to post answers about every aspect of Docker imaginable. Otherwise we'd just have a single question with millions of answers per topic.
    – BoltClock
    Jan 9, 2018 at 5:51
  • 1
    Both the comment and the upvotes on the answer indicate that the answer is really being helpful. But do you agree that it's useful? You're allowed to disagree with the previous voters.
    – BSMP
    Jan 9, 2018 at 6:41
  • I can't find it now but there was a Meta question about what to do with answers that just repeat the code in the question. That would be relevant to this as well.
    – BSMP
    Jan 9, 2018 at 6:41
  • 2
    Found it. The current answer says that repeating the code in the question doesn't make it Not An Answer: meta.stackoverflow.com/questions/361317/…
    – BSMP
    Jan 9, 2018 at 6:57
  • 4
    It certainly is an answer. It just isn't the right answer. So flagging it as not an answer would just be wrong. You can downvote it if you wish (since it may be generally helpful, but it isn't helpful on that question). But I certainly wouldn't flag it, and I would personally leave it be.
    – Erik A
    Jan 9, 2018 at 8:21
  • 2
    @ErikvonAsmuth Is it really a "wrong answer" if it answers a different question? In that case EVERY answer would fit as an answer to EVERY question, as long as it qualifies for an answer.
    – klutt
    Jan 9, 2018 at 14:27
  • 1
    Yeah, as @klutt says, I don't think it's enough if an answer attempts to answer some question someone might have somewhere. It must be an attempt to answer the question it is posted as an answer to.
    – Baum mit Augen Mod
    Jan 9, 2018 at 14:31
  • 2
    If we look at this global meta post, Shog is pretty explicit that anything that is an answer, even if it's terrible, still is an answer and shouldn't be flagged as not an answer. I've had trouble with that concept and have had declined NAA flags, but this is what I currently believe. We can do very little but downvote answers that aren't applicable to the question, and delete vote if downvoted enough and if you have sufficient rep
    – Erik A
    Jan 9, 2018 at 14:35
  • 1
    @ErikvonAsmuth An answer like 3 + 3 = 5 is certainly not an answer to the question "why chose technology x?". Being it a terrible (quality!!) answer means downvoting, being it not an answer to the question means a flag. Jan 9, 2018 at 15:22
  • 1
    I believe answers can be moved using a tool. Perhaps a more suitable question could be found?
    – user4639281
    Jan 9, 2018 at 16:05
  • 2
    @HimBromBeere The NaA flag should be used for things that are not answers at all. It should not be used for answers that were posted to the wrong question, nor answers that are technically inaccurate or altogether wrong.
    – user4639281
    Jan 9, 2018 at 16:07
  • 1
    @Tiny Giant: Answers cannot be moved.
    – BoltClock
    Jan 9, 2018 at 16:16
  • 2
    @ErikvonAsmuth "Shog is pretty explicit that anything that is an answer, even if it's terrible, still is an answer and shouldn't be flagged as not an answer" where? The only thing I read is "if the text of the post contains an honest attempt at answering the question", not any question, not a question, but the question in... question.
    – Braiam
    Jan 9, 2018 at 16:16
  • 3
    @Maroun Sure, because a better question apparently doesn't exist. So create that better question so that people aren't directed to the wrong question when they have that problem. You can also link to the new question in the comments so that if others still come across the old question they can find a question asking about the problem that they actually have.
    – Servy
    Jan 9, 2018 at 16:27

2 Answers 2

4

This answer should be posted under a question that it actually answers, rather than being posted to an entirely off topic question. If there's a need for a question that explains how to build an image with custom name without using yml file, then ask a question that asks, "How to build an image with custom name without using yml file?", with that answer under it. You could post a comment linking to that related question from the question it was originally posted under, if people going to that question might be interested in the other question.

6
  • So, delete the answer?
    – Braiam
    Jan 9, 2018 at 16:13
  • @Braiam I'm still undecided on that one. Ideally the author would do all of this, and delete the answer as a part of it. It seems borderline as to whether the answer merits moderator deletion. I lean towards it probably doesn't, but only just, but I could understand someone interpreting things such that they went the other way.
    – Servy
    Jan 9, 2018 at 16:16
  • @Braiam More specifically, I could imagine someone interpreting that answer's opening sentence as acknowledging that they are trying to answer a different question than the one asked, which would make it merit deletion (as it's not even trying to answer the question). I could also imagine someone interpreting it as the answer indicating that that's what they think the question is asking, which would make it not merit deletion. I do think it would be appropriate for 20k users to vote to delete it, but as it needs to be negatively scored for that to happen, that's a non-factor.
    – Servy
    Jan 9, 2018 at 16:17
  • @Braiam While the answer is not relevant to the specific question, people seem to reach it without looking for "Dockerfile". I'm not sure if deleting it is the correct thing to do.
    – Maroun
    Jan 9, 2018 at 16:24
  • 2
    @Maroun If people are being directed to an off topic question, because that's the only place that has an answer to this question, then that's a problem. We want people looking for how to build an image with a custom name without using a yml file to find a question actually asking that that has their answer, not a question asking something unrelated that has the answer. If the answer is only on an off topic question than lots of people will see that the question isn't asking what they want to solve and so not read the answers.
    – Servy
    Jan 9, 2018 at 16:26
  • @Servy I'll have to agree.
    – Maroun
    Jan 9, 2018 at 16:28
1

If there is already a good answer that answers the question, it is sometimes ok to add a complimentary one, which doesn't directly answer the question but adds additional important details to the topic. I can't tell if this is the case here, since I don't know the topic.

When posting such a complimentary answer, it is good practice to start with something like "nn has already answered the question, but...". This indicates that the post does in fact not answer the question directly, as it was stated. But such complimentary answers still have to be on-topic.

Examples of complimentary answers that could be ok:

  • An example of why the accepted answer, although it answers the question, is bad or non-recommended practice in real applications.
  • An answer that points out things to consider or things that can go wrong when using the method proposed in the accepted answer.
  • An answer that offers an alternative method to what the question was asking for. It could perhaps suggest to do something else entirely, instead of what the OP was asking for. This could be appropriate for some "XY questions".
  • A late answer that clarifies how the question/accepted answer is no longer relevant because the method used has gone obsolete since the point when the question was asked.

As a rule of thumb, if something could have been added to the accepted answer in the form of an intrusive edit (which is not ok), then it would probably make a good complimentary answer instead.

Example of complimentary answers that are not ok (not an answer, quite possibly spam):

  • "Oh I see you posted a question about technology x. When working with technology x, here is some generic good advice: ..."
  • A complementary link-only answer to documentation or resources. These should be posted as comments, if at all.
5
  • 2
    A complimentary answer still takes the question into account somehow, and that applies to each of these examples, even the XY question ones (provided they explicitly acknowledge this about the question). The kind of answer this question is referring to, is one that's so far off it might as well have been posted under the wrong question by mistake; the problem being described is that people are somehow not only discovering the answer despite having no real connection to the question, but also finding it helpful, thanks in probably no small part to the weird and wonderful world of web searches.
    – BoltClock
    Jan 9, 2018 at 15:57
  • @BoltClock In that case it seems it falls into the category of "here is some generic good advise". Is that answer worth preserving? (I really can't tell, and I wouldn't trust the number of up-votes.) If it is helpful, maybe someone could post a new, different question and have the answer exported there?
    – Lundin
    Jan 9, 2018 at 16:03
  • 1
    The first, second, and fourth options you list are just commentary on another answer, and are NAA. The should be posted as comments to the posts they're replying to. The third is an answer to the question, just not necessarily the one that the OP was expecting, which is fine.
    – Servy
    Jan 9, 2018 at 16:08
  • 2
    @Servy It is not always possible to post comments. You may need to write plenty of text. You may need to post code examples, for which comments are entirely unsuitable. And so on. A strict, bureaucratic black & white attitude that everything must always be an answer to the question, is not helpful and leads to worse technical quality of the content posted on the site. Quite often the OP asks about something which is a bad idea. The site benefits from showing the OP why it is a bad idea, not by teaching them how to carry out stupid things by answering the question.
    – Lundin
    Jan 10, 2018 at 7:37
  • 1
    @Lundin That's exactly the attitude that most sites other than SO take; that you shouldn't separate out answers from commentary on other posts. SO make the explicit choice before it was even created that that caused way more problems than it solved, and that answers should be posted as answers, while commentary on other posts should be separated out. As I said before, if you want to provide a different solution to the problem, your third option, that's an answer, but just commentary on other answers is not, and has its own place.
    – Servy
    Jan 10, 2018 at 14:16

Not the answer you're looking for? Browse other questions tagged .