Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

astroImageTools failing only inside a docker container, with no usefull trace or error #155

Open
epetre opened this issue Feb 2, 2023 · 0 comments

Comments

@epetre
Copy link

epetre commented Feb 2, 2023

Intro

I thought I'd share this here since I got stuck on it for quite a bit, but don't know what is wrong.
I basically turned it off but wanted to share it in case you already know something or in case someone else runs into this issue.

The setup

I run the boilerplate demo inside a docker container.
The build works every time locally even inside a docker container setup exactly the same way.
When running it in the Linode Ubuntu 20.4, it just crashes.

# Stage 1 - Building image
FROM node:19-alpine3.16 as node

# set working direction (just a name for the project)
WORKDIR /app/

#package and package-lock.json both go in
COPY package.json ./

RUN npm install

COPY . .

RUN npm run build --verbose# Stage 1 - Building image
FROM node:19-alpine3.16 as node

# set working direction (just a name for the project)
WORKDIR /app/

#package and package-lock.json both go in
COPY package.json ./

RUN npm install

COPY . .

RUN npm run build --verbose

# Stage 2 - Running image
FROM 'nginx:latest'

COPY --from=node /app/dist /usr/share/nginx/html

EXPOSE 80 443
CMD [ "nginx", "-g", "daemon off;" ]

in astro.config.mjs

    integrations: [
       react(),
       tailwind({}),
       sitemap(),
       robotsTxt(),
       astroImageTools,
    ],

commenting this line makes the whole thing work:

astroImageTools

Here is the error

npm verb stack Error: command failed
npm verb stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27)
npm verb stack     at ChildProcess.emit (node:events:512:28)
npm verb stack     at maybeClose (node:internal/child_process:1098:16)
npm verb stack     at ChildProcess._handle.onexit (node:internal/child_process:304:5)
npm verb pkgid [email protected]
npm verb cwd /app
npm verb Linux 5.4.0-137-generic
npm verb node v19.5.0
npm verb npm  v9.3.1
npm ERR! path /app
npm ERR! command failed
npm ERR! signal SIGKILL
npm ERR! command sh -c astro build
npm verb exit 1
npm verb code 1

npm ERR! A complete log of this run can be found in:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant