DannyLongFingers
DannyLongFingers

Reputation: 96

AWS ECS OCI runtime create failed: runc create failed: args must not be empty: unknown

I'm trying to deploy a service to ECS. It's a very simple Dockerfile and the container fails to deploy with the error: CannotStartContainerError: ResourceInitializationError: failed to create new container runtime task: failed to create shim task: OCI runtime create failed: runc create failed: args must not be empty: unknown:.

Not sure what that means. It sounds like it failed to create a container because an argument wasn't defined somewhere.

This is the Dockerfile

FROM node:16

RUN mkdir -p /home/node/app/node_modules/ && chown -R node:node /home/node/app

WORKDIR /home/node/app
COPY . /home/node/app

RUN npm install
RUN npm run build
RUN chmod +x /home/node/app/start.sh

ENTRYPOINT [ "/bin/sh", "./start.sh" ]

The start.sh script is very simple, it echos some text, sets a few environment variables and calls into a node service. The fact that cloudwatch doesn't display anything echoed from this script makes it look like it isn't calling the script at all.

I tried using the same exact taskdef to deploy other containers successfully I tried CMD instead of ENTRYPOINT which didn't change anything I tried using node-alpine instead of node It appears that there's something wrong this this specific container but it runs fine locally.

I've been trying to decipher what this error means for ~8 months now without much luck.

Upvotes: 0

Views: 588

Answers (1)

DannyLongFingers
DannyLongFingers

Reputation: 96

Got it...

I had to explicitly define entrypoint, command and workingDirectory in the taskdef. Didn't seem to be picked up from the Dockerfile.

"entryPoint": [
    "/bin/bash",
    "-c"
],
"command": [
    "./start.sh"
],
"workingDirectory": "/home/node/app",

Upvotes: 1

Related Questions