1

I've setup Docker at my Windows machine, since my Windows machine is more powerful than my Macbook. However, I do like MacOS more.

So I've setup a Docker context to use remote Windows machine using command docker context create remote ‐‐docker “host=ssh://user@host”.

Now when I try to use following set of commands:

docker context use remote
docker-compose up --build

Everything works ok, but I don't get live logs from my containers. When I do docker-compose up --build locally - I get live logs.

What can I do to get live logs from remote containers?

Here is what I have when I execute both remotely and locally:

Creating network "target_default" with the default driver
Creating volume "target_storage" with default driver
Building server
[+] Building 10.1s (10/10) FINISHED
 => [internal] load build definition from Dockerfile                                                               0.3s
 => => transferring dockerfile: 390B                                                                               0.0s
 => [internal] load .dockerignore                                                                                  0.3s
 => => transferring context: 2B                                                                                    0.0s
 => [internal] load metadata for docker.io/library/openjdk:8-jre-slim                                              0.6s
 => CACHED [1/5] FROM docker.io/library/openjdk:8-jre-slim@sha256:0330883ffeb5e14c4c15271004cdf6a2df21e827420b71d  0.0s
 => [internal] load build context                                                                                  8.2s
 => => transferring context: 91.16MB                                                                               8.2s
 => [2/5] RUN groupadd -r user &&     useradd -r -g user -m -s /usr/bin/nologin -c "Docker image user" user        0.3s
 => [3/5] COPY --chown=user:user [server-[{0-9.}]*-SNAPSHOT.jar, server.sh, /home/user/]                         0.2s
 => [4/5] WORKDIR /home/user                                                                                       0.0s
 => [5/5] RUN sed -i 's/localhost/data/g' server.sh &&     mkdir ./storage                                   0.3s
 => exporting to image                                                                                             0.4s
 => => exporting layers                                                                                            0.3s
 => => writing image sha256:3daf841e0b9749e1dcb7135e85b16a81104b84caa35930a423ecc6d460d6e8fd                       0.0s
 => => naming to docker.io/library/server:1.0-8-jre-slim                                                   0.0s
Successfully built 3daf841e0b9749e1dcb7135e85b16a81104b84caa35930a423ecc6d460d6e8fd
Creating target_server_1    ... done
Attaching to target_server_1    

But when I do it locally, after the last line above I get all my logs from 'target_server_1' live. Remotely it just stops there, silently.

Leviann
  • 59
  • 4
  • Possible duplicate: [Docker build not showing any output from commands](https://stackoverflow.com/a/64805337/596285) – BMitch Apr 06 '21 at 12:46
  • @BMitch nope. I have output when run docker locally. It does not work for remote docker. – Leviann Apr 06 '21 at 12:48
  • But what do you see? Include the output of the commands you are running in your question. – BMitch Apr 06 '21 at 12:51
  • @BMitch added output and more explanation. – Leviann Apr 06 '21 at 13:06
  • That output is buildkit. If you need control over flags like the progress flag you'll probably need to build outside of docker-compose. And to disable buildkit and go back to the classic build interface, see the duplicate question. – BMitch Apr 06 '21 at 14:02
  • @BMitch I don't need any progress of build. And it shows it anyway. What I need are logs inside container. Logs of the app itself, on terminal – Leviann Apr 06 '21 at 18:28

0 Answers0