patterndockerModerate
No longer see Docker build output properly!
Viewed 0 times
dockerlongerproperlyoutputseebuild
Problem
I am using the latest version of Docker Desktop on Windows (Docker Engine version v19.03.13).
After the last update, the output of
Here is my
When I run
```
jwan@home-desktop MSYS /c/code/phoneden (upgrade/net-3.1)
$ docker build --no-cache .
[+] Building 38.9s (16/16) FINISHED
=> [internal] load .dockerignore
After the last update, the output of
docker build . has changed! It is now harder to debug what is going on.Here is my
Dockerfile:# set base image as the dotnet 3.1 SDK.
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
# set the working directory for any RUN, CMD, ENTRYPOINT, COPY and ADD
# instructions that follows the WORKDIR instruction.
WORKDIR /app
# debug purposes - see where we are
RUN pwd
# our current working directory within the container is /app
# we now copy all the files (from local machine) to /app (in the container).
COPY . ./
# debug purposes - list files in current folder
RUN ls -la
# run unit tests within the solution.
RUN dotnet test Phoneden.sln
# again, on the container (we are in /app folder)
# we now publish the project into a folder called 'out'.
RUN dotnet publish Phoneden.Web/Phoneden.Web.csproj -c Release -o out
# debug purposes - list files in current folder
RUN ls -la
# set base image as the dotnet 3.1 runtime.
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS runtime
# telling the application what port to run on.
ENV ASPNETCORE_URLS=http://*:5005
# set the working directory for any RUN, CMD, ENTRYPOINT, COPY and ADD
# instructions that follows the WORKDIR instruction.
WORKDIR /app
# copy the contents of /app/out in the `build-env` and paste it in the
# `/app` directory of the new runtime container.
COPY --from=build-env /app/Phoneden.Web/out .
# set the entry point into the application.
ENTRYPOINT ["dotnet", "Phoneden.Web.dll", "-seed"]When I run
docker build --no-cache . I get the following:```
jwan@home-desktop MSYS /c/code/phoneden (upgrade/net-3.1)
$ docker build --no-cache .
[+] Building 38.9s (16/16) FINISHED
=> [internal] load .dockerignore
Solution
This is the output from buildkit. You can run buildkit based builds with a different output syntax:
In your command, that would be:
Or you can disable buildkit by setting
$ docker build --help
...
--progress string Set type of progress output (auto, plain, tty). Use plain to show container output
(default "auto")In your command, that would be:
docker build --progress=plain .Or you can disable buildkit by setting
DOCKER_BUILDKIT=0 in your shell:DOCKER_BUILDKIT=0 docker build .Code Snippets
$ docker build --help
...
--progress string Set type of progress output (auto, plain, tty). Use plain to show container output
(default "auto")docker build --progress=plain .DOCKER_BUILDKIT=0 docker build .Context
StackExchange DevOps Q#12771, answer score: 12
Revisions (0)
No revisions yet.