missing -f flag that indicates the name of the Dockerfile to use

Chad Sellers 20 Reputation points
2024-04-15T18:20:51.85+00:00

Missing -f flag in example that indicates the name of the Dockerfile to use for "Customize a Docker image to run your own web app" --> https://learn.microsoft.com/en-us/training/modules/intro-to-containers/4-create-custom-docker-image

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,176 questions
0 comments No comments
{count} votes

Accepted answer
  1. Marcin Policht 10,840 Reputation points MVP
    2024-04-15T18:43:11.6133333+00:00

    This switch is optional. It is not required if Dockerfile resides in the current directory (which is implied by the trailing period)

    As per https://docs.docker.com/reference/cli/docker/image/build/

    By default the docker build command looks for a Dockerfile at the root of the build context. The -f, --file, option lets you specify the path to an alternative file to use instead. This is useful in cases that use the same set of files for multiple builds. The path must be to a file within the build context. Relative path are interpreted as relative to the root of the context.


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    0 comments No comments

0 additional answers

Sort by: Most helpful