Skip to content

Commit

Permalink
Fix image not running in K8s (ROSA) (#24)
Browse files Browse the repository at this point in the history
Fix image not running in K8s (ROSA)

Trying to solve the container exiting with error code `243`. `npm` throws `243` for any command you try to run with it.

Here is how to get into the container while the entrypoint normally errors.
```
$ oc run -i --tty --image=ghcr.io/matrix-org/matrix-public-archive/matrix-public-archive:sha-65edaea1a9713bb2cc93fa98638327fdeff765cd mpa-test2 --port=3050 --restart=Never --env="DOMAIN=cluster" --command /bin/bash
$ npm start

$ echo $?
243
```

Why does the same image work in Docker?
```
$ docker run -it --entrypoint /bin/bash ghcr.io/matrix-org/matrix-public-archive/matrix-public-archive:sha-65edaea1a9713bb2cc93fa98638327fdeff765cd
$ npm start
# it starts ✅
```


## Root cause

Seems like it could be either of these issues. Both are `8.6.0`+ problems as well which lines up with the `npm` version available in each base image.

 - npm/cli#4769
 - npm/cli#4996
    - Specific comment about breaking stuff in k8s for other people, npm/cli#4996 (comment)
  • Loading branch information
MadLittleMods committed Jun 15, 2022
1 parent bd5c142 commit 724c562
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
@@ -1,11 +1,13 @@
FROM node:16.15-buster-slim
# XXX: Before updating this, make sure the issues around `npm` silently exiting
# with error 243 issues are solved:
# - https://github.com/npm/cli/issues/4996
# - https://github.com/npm/cli/issues/4769
FROM node:16.14.2-buster-slim

RUN mkdir -p /app

WORKDIR /app

RUN npm install npm@^8 --location=global

# Copy the health-check script
COPY docker-health-check.js /app/

Expand Down

0 comments on commit 724c562

Please sign in to comment.