pawelmalak / snippet-box

Snippet Box is a simple self-hosted app for organizing your code snippets. It allows you to easily create, edit, browse and manage your snippets in various languages.
MIT License
977 stars 80 forks source link

Docker build failed - Ubuntu 20.04 amd64 #8

Closed fmoledina closed 3 years ago

fmoledina commented 3 years ago

Steps taken:

git clone https://github.com/pawelmalak/snippet-box.git
docker build -t snippet-box:master .

Build output:

Sending build context to Docker daemon  2.068MB                                             
Step 1/12 : FROM node:14-alpine                                                             
14-alpine: Pulling from library/node                                                        
6a428f9f83b0: Already exists                                                                                                                                                             
630852b09df4: Already exists                  
f13ad23a48a4: Already exists                                                                
43df7c393f3d: Already exists                                                                                                                                                             
Digest: sha256:8c94a0291133e16b92be5c667e0bc35930940dfa7be544fb142e25f8e4510a45
Status: Downloaded newer image for node:14-alpine                                           
 ---> 1d909dafa77f                                                                          
Step 2/12 : WORKDIR /app                                                                                                                                                                 
 ---> Running in b8d74a59066f                                                               
Removing intermediate container b8d74a59066f  
 ---> 79c61ed25b3b                            
Step 3/12 : COPY package*.json ./                                                           
 ---> 363b7669dd1c                      
Step 4/12 : RUN npm install                   
 ---> Running in 4bcb94c9e1e0                                                                                                                                                            

> sqlite3@5.0.2 install /app/node_modules/sqlite3                                                                                                                                        
> node-pre-gyp install --fallback-to-build                                                                                                                                               

node-pre-gyp WARN Using request for node-pre-gyp https download                                                                                                                          
[sqlite3] Success: "/app/node_modules/sqlite3/lib/binding/napi-v3-linux-x64/node_sqlite3.node" is installed via remote           

> nodemon@2.0.12 postinstall /app/node_modules/nodemon
> node bin/postinstall || exit 0                                                            

Love nodemon? You can now support the project via the open collective:
 > https://opencollective.com/nodemon/donate                                                                                                                                             

npm WARN snippet-hub@1.0.0 No description                                                                                                                                                
npm WARN snippet-hub@1.0.0 No repository field.                                             
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 401 packages from 492 contributors and audited 404 packages in 11.865s

44 packages are looking for funding                                                         
  run `npm fund` for details                                                                

found 5 high severity vulnerabilities                                                                                                                                                    
  run `npm audit fix` to fix them, or `npm audit` for details
Removing intermediate container 4bcb94c9e1e0                                                                                                                                             
 ---> 62cbd2edd941                            
Step 5/12 : COPY . .                                                                                                                                                                     
 ---> b7b8edb43531
Step 6/12 : RUN mkdir -p ./public ./data
 ---> Running in 770e8ba95219
Removing intermediate container 770e8ba95219
 ---> ba25361c21f9
Step 7/12 : RUN npm run build
 ---> Running in 8a5ed0d921ab

> snippet-hub@1.0.0 build /app
> npm-run-all -n build:**

> snippet-hub@1.0.0 build:clear /app/package.json
> rm -rf build 

> snippet-hub@1.0.0 build:clear /app
> rm -rf build

> snippet-hub@1.0.0 build:tsc /app/package.json
> tsc 

> snippet-hub@1.0.0 build:tsc /app
> tsc

Removing intermediate container 8a5ed0d921ab
 ---> 438cce7800ce
Step 8/12 : RUN cd ./client     && npm install --production     && npm run build     && cd ..     && mv ./client/build/* ./public
 ---> Running in 264ab18dc3cf

> core-js@2.6.12 postinstall /app/client/node_modules/babel-runtime/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock
> https://paypal.me/zloirock 
> bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> core-js-pure@3.17.3 postinstall /app/client/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js:
> https://opencollective.com/core-js 
> https://patreon.com/zloirock 
> https://paypal.me/zloirock 
> bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> ejs@2.7.4 postinstall /app/client/node_modules/ejs
> node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 2022 packages from 849 contributors and audited 2030 packages in 47.315s

203 packages are looking for funding
  run `npm fund` for details

found 3 moderate severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

> client@0.1.0 build /app/client
> react-scripts build

Creating an optimized production build...
Failed to compile.

/app/client/src/App.tsx
TypeScript error in /app/client/src/App.tsx(1,46):
Could not find a declaration file for module 'react-router-dom'. '/app/client/node_modules/react-router-dom/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/react-router-dom` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-router-dom';`  TS7016

  > 1 | import { BrowserRouter, Switch, Route } from 'react-router-dom';
      |                                              ^
    2 | import { Navbar } from './components/Navigation/Navbar';
    3 | import { Editor, Home, Snippet, Snippets } from './containers';
    4 | import { SnippetsContextProvider } from './store';

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the client@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-09-23T19_00_22_675Z-debug.log
The command '/bin/sh -c cd ./client     && npm install --production     && npm run build     && cd ..     && mv ./client/build/* ./public' returned a non-zero code: 1

System info: Ubuntu 20.04.3 amd64

Docker version:

$ docker version
Client: Docker Engine - Community
 Version:           20.10.8
 API version:       1.41
 Go version:        go1.16.6
 Git commit:        3967b7d
 Built:             Fri Jul 30 19:54:27 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.8
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.6
  Git commit:       75249d8
  Built:            Fri Jul 30 19:52:33 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.9
  GitCommit:        e25210fe30a0a703442421b0f60afac609f950a3
 runc:
  Version:          1.0.1
  GitCommit:        v1.0.1-0-g4144b63
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Let me know what more information I can provide. Thank you.

pawelmalak commented 3 years ago

I just pushed code with possible fix. Can you try again?

fmoledina commented 3 years ago

Works, thanks.

snippets