Running binary via node js in EKS leads to permission denied error

0 votes

The code functions well elsewhere and on the local system, so it is a permissions issue. The permission denied error is logged in the location where the binary is intended to be utilised after deployment using EKS in AWS.

Node.js

const exec = require("child_process").exec;
exec(`./binaryName -i ${file_name} -o ${file_name}`, (error, stdout, stderr) => {
            if (error) {
... //redacted for irrelevance

The dockerfile

FROM node:14

WORKDIR /usr/src/app

COPY package*.json ./

RUN npm install

RUN addgroup --group dockergroup \
&& adduser \
    "dockeruser" 

RUN chown dockeruser:dockergroup  /usr/src/app /tmp
USER dockeruser:dockergroup 

# Bundle app source
COPY . .

EXPOSE 8080
CMD [ "node", "index.js" ]

The user group component was added after reviewing several threads on stackoverflow; otherwise, the code functions properly. However, the permission denied error continues to appear.

Dec 13, 2022 in AWS by Roshan
• 300 points

edited 6 days ago 9 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP