voidlabs / mosaico

Mosaico - Responsive Email Template Editor
https://mosaico.io
GNU General Public License v3.0
1.69k stars 500 forks source link

Docker error when launching #573

Closed jamie-tillman closed 4 years ago

jamie-tillman commented 4 years ago

On Windows 10:

>clone https://github.com/voidlabs/mosaico.git
>cd mosaico
>docker build -t mosaico/mosaico .

##build runs with many warnings but does complete with final warning of:
##SECURITY WARNING: You are building a Docker image from Windows against a non-Windows ##Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is ##recommended to double check and reset permissions for sensitive files and directories.

>docker run -p 9006:9006 mosaico/mosaico
/opt/mosaico/node_modules/grunt/node_modules/mkdirp/lib/opts-arg.js:7
    opts = { mode: 0o777, fs, ...opts }
                              ^^^

SyntaxError: Unexpected token ...
  at createScript (vm.js:56:10)
  at Object.runInThisContext (vm.js:97:10)
  at Module._compile (module.js:549:28)
  at Object.Module._extensions..js (module.js:586:10)
  at Module.load (/opt/mosaico/node_modules/coffeescript/lib/coffee-script/register.js:45:36)
  at tryModuleLoad (module.js:453:12)
  at Function.Module._load (module.js:445:3)
  at Module.require (module.js:504:17)
  at require (internal/module.js:20:19)
  at Object.<anonymous> (/opt/mosaico/node_modules/grunt/node_modules/mkdirp/index.js:1:79)
  at Module._compile (module.js:577:32)
  at Object.Module._extensions..js (module.js:586:10)
  at Module.load (/opt/mosaico/node_modules/coffeescript/lib/coffee-script/register.js:45:36)
  at tryModuleLoad (module.js:453:12)
  at Function.Module._load (module.js:445:3)
  at Module.require (module.js:504:17)
  at require (internal/module.js:20:19)
  at Object.<anonymous> (/opt/mosaico/node_modules/grunt/lib/grunt/file.js:20:31)
  at Module._compile (module.js:577:32)
  at Object.Module._extensions..js (module.js:586:10)
  at Module.load (/opt/mosaico/node_modules/coffeescript/lib/coffee-script/register.js:45:36)
  at tryModuleLoad (module.js:453:12)
  at Function.Module._load (module.js:445:3)
  at Module.require (module.js:504:17)
  at require (internal/module.js:20:19)
  at gRequire (/opt/mosaico/node_modules/grunt/lib/grunt.js:14:24)
  at Object.<anonymous> (/opt/mosaico/node_modules/grunt/lib/grunt.js:28:1)
  at Module._compile (module.js:577:32)
  at Object.Module._extensions..js (module.js:586:10)
  at Module.load (module.js:494:32)
  at tryModuleLoad (module.js:453:12)
  at Function.Module._load (module.js:445:3)
  at Module.require (module.js:504:17)
  at require (internal/module.js:20:19)
  at Liftoff.<anonymous> (/usr/local/lib/node_modules/grunt-cli/bin/grunt:65:19)
  at Liftoff.execute (/usr/local/lib/node_modules/grunt-cli/node_modules/liftoff/index.js:203:12)
  at module.exports (/usr/local/lib/node_modules/grunt-cli/node_modules/flagged-respawn/index.js:51:3)
  at Liftoff.<anonymous> (/usr/local/lib/node_modules/grunt-cli/node_modules/liftoff/index.js:195:5)
  at Liftoff.<anonymous> (/usr/local/lib/node_modules/grunt-cli/node_modules/liftoff/index.js:170:7)
  at _combinedTickCallback (internal/process/next_tick.js:73:7)
  at process._tickCallback (internal/process/next_tick.js:104:9)

Any idea where to start? I'm thinking the "building on windows" warning and the error may be related.

techish commented 4 years ago

I am also getting the same error on MacOSx.

inknos commented 4 years ago

Same error on fedora31. Same steps to reproduce. Tried both with docker and podman.

$ uname -a
Linux localhost.localdomain 5.6.6-200.fc31.x86_64 #1 SMP Tue Apr 21 15:34:22 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ docker -v
Docker version 19.03.8, build afacb8b
$ podman -v
podman version 1.9.0
bago commented 4 years ago

One of the recently upgraded dependencies uses the javascript spread operator that is only available since Node 8, while Docker/Docker.CENTOS images use a Node 6 base image.

bago commented 4 years ago

I updated the base Docker image to 8-alpine (node 8 instead of node 6) and the Docker.Centos image to Centos8: this should have fixed the issue.

The docker CI pass: https://hub.docker.com/r/mosaico/mosaico/builds

I didn't actually check the docker build so please if this didn't fix your issue reopen this one.