Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build logs unreadable #1881

Closed
frederikhors opened this issue Sep 15, 2023 · 4 comments
Closed

Docker build logs unreadable #1881

frederikhors opened this issue Sep 15, 2023 · 4 comments

Comments

@frederikhors
Copy link

frederikhors commented Sep 15, 2023

I'm on caprover v1.11.0 and I'm using this CLI command:

caprover deploy --caproverUrl https://captain.domain --caproverApp appName --tarFile tarName

It works but the Docker build logs are like the below both in my console and on captain's app's dashboard "Deployment" tab:

   Compiling either v1.9.0              
                                        
   Compiling sha1 v0.10.5               
                                        
   Compiling indexmap v1.9.3            
                                        
   Compiling minimal-lexical v0.2.1     
                                        
Compiling                               
                                        
base64                                  
 v                                      
0                                       
.                                       
21                                      
.                                       
3

.                                                             
14                                                            
.ompiling                                                     
0                                                             
ignore                                                        
 v                                                            
   Compiling tokio-util v0.12.2                                  
.                                                             
                                                              
 0                                                            
Compiling                                                     
                                                              
hyper                                                         
 v                                                            
0                                                             
.ompiling                                                     
14                                                            
.lap_derive                                                   
27                                                            
4                                                             
.                                                             
                                                              
 Compiling                                                    
                                                              
tower-service v                                           
0                                                             
.12                                                           
.                                                             
2ompiling                                                     
                                                              
 lap_builder                                                  
 v                                                            
                                                              
Compiling                                                     
                                                              
common                                                        
 v                                                            
0                                                             
.                                                             
0                                                             
.                                                             
1                                                             
 (mpiling                                                     
/common                                      
)oml                                                          
 v                                                            
0                                                             
   Compiling router v0.0.1 (/src/router)      
7                                                             
.                                                             
8                                                             
                                                              
                                                              
[[ TRUNCATED ]]                                               
1               
          Compiling
   Compiling tokio-util v0.7.8                                    

and so on...

It's unreadable to say the least.

Why?

Is the Docker logs system?

Can we use the --progress plain argument on the docker build command? How?

@githubsaturn
Copy link
Collaborator

It is the docker build output.
https://github.com/caprover/caprover/blob/master/src/docker/DockerApi.ts#L628-L631

Does it happen for all builds a particular image? Can you try a simply build like this:

FROM node:18
RUN npm i -g caprover
CMD sleep 10d

This should generate some output in your logs and it should be perfectly normal.

@frederikhors
Copy link
Author

I used method 4.

The build logs:

------------------------- Sat Sep 16 2023 11:01:59 GMT+0000 (Coordinated Universal Time)
Build started for amazing-app
Ignore warnings for unconsumed build-args if there is any
Step 1/3 : FROM node:18

---> c9cdd0572143
Step 2/3 : RUN npm i -g caprover

---> Running in a3a5e5009906
npm WARN deprecated
 [email protected]: this library is no longer supported

npm WARN deprecated [email protected]: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142

npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

added 200 packages in 10s
9 packages are looking for funding
  run `npm fund` for details
npm notice 
npm 
notice New major version of npm available! 9.6.7 -> 10.1.0
npm
 notice
 Changelog: <https://github.com/npm/cli/releases/tag/v10.1.0>
npm notice Run `npm install -g [email protected]` to update!
npm
 
notice
 

Removing intermediate container a3a5e5009906
---> 2c7522fa7055
Step 3/3 : CMD sleep 10d

---> Running in d63d245a4a10
Removing intermediate container d63d245a4a10
---> 62b3c622904f
Successfully built 62b3c622904f
Successfully tagged img-captain-amazing-app:latest
Build has finished successfully!

This is normal as you said.

Is there a way we can fix this?

I fixed this temporarily using docker build manually via ssh.

Hence the issue #1883.

@githubsaturn
Copy link
Collaborator

So looks like your container's build process is somehow throwing some garbage character into the logs.... It's apparently specific to your build. If you can share a sample Dockerfile that reproduces the issue, I can look into that.

@frederikhors
Copy link
Author

It's a rust build. I cannot share unfortunately. Anyway I found a workaround. Thank you very much (for now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants