Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:14.21.1-alpine

WORKDIR /

COPY . .

RUN npm install
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if makefile runs npm install then there is no need for this line

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The full version of node is quite heavy, if we can get away with the alpine version, it would mean a much smaller docker image size. The only caveat is we may need to install git on the alpine version, as it does't come with that.


CMD cat overlay.yaml | node bin.js
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can set the command to be bin.js, that way it's possible to make use of stdin and we may not need to mount files. Although mounting files may prove useful later on.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was more of a suggestion on how to do it. I'm happy with any way you think would work the best. For example when we use this we are running command:

docker run --rm -v=${PWD}/overlay.yaml:/overlay.yaml -v=${PWD}/test.yaml:/test.yaml jasmingacic/overlay-cli

We can adjust to run it any other way.

And you are absolutely right about the docker image I used here. Current size is about 140MB. I'm not well versed with Node so I took the first thing I found.

Do you want me to add those changes?

4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PLATFORM?=linux/amd64

build:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

possible solution would be to run npm install here

Suggested change
build:
build:
npm install

docker buildx build --platform ${PLATFORM} -t overlay-cli .