org-formation / org-formation-cli

Better than landingzones!
MIT License
1.4k stars 129 forks source link

Docker image needs node update for version 1.0.13 #544

Closed jim-barber-he closed 7 months ago

jim-barber-he commented 7 months ago

Subject of the issue

Currently the Docker image for version 1.0.13 throws the following error when invoked no matter what parameters you pass the org-formation command:

/usr/local/lib/node_modules/aws-organization-formation/node_modules/@aws-sdk/client-iam/dist-cjs/index.js:307
    useDualstackEndpoint: options.useDualstackEndpoint ?? false,
                                                        ^

SyntaxError: Unexpected token '?'
    at wrapSafe (internal/modules/cjs/loader.js:1053:16)
    at Module._compile (internal/modules/cjs/loader.js:1101:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/aws-organization-formation/dist/src/util/aws-util.js:32:22)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)

It is because the Dockerfile that builds the image is still using node version 12.

$ grep FROM Dockerfile 
FROM        node:12.18-alpine3.11

I edited the Dockerfile and set that line to

FROM        node:18-alpine

Then rebuilt a local image and used that, and everything was fine.

Your environment

Not really relevant since it is the Docker image that is broken. Running org-formation directly from my PC works fine.

Steps to reproduce

Tell us how to reproduce this issue. Please provide ofn projct files if possible, you can use this template as a base. https://plnkr.co/edit/m568SDw2KPufQsUl

I can simply try to run the help command for org-formation via its docker image like so:

docker run --rm -it orgformation/org-formation-cli:1.0.13 help

Expected behaviour

No errors

Actual behaviour

Totally broken :)