I have Dockerfile build like this
FROM node:18-alpine
RUN mkdir /workspace
WORKDIR /workspace
RUN wget -qO- https://get.pnpm.io/v6.16.js | node - add --global pnpm
COPY .npmrc package.json pnpm-lock.yaml .pnpmfile.cjs ./
RUN CI=true pnpm install --frozen-lockfile
COPY . ./
RUN CI=true pnpm build
This works fine when I run docker build . directly, but when I run this under dagger this fails
import { connect } from "@dagger.io/dagger";
connect(async (client) => {
// set build context
const contextDir = client.host().directory(".")
// build using Dockerfile
// publish the resulting container to a registry
const build = await client.container()
.build(contextDir, )
const ls = await build
.withExec(['ls', '-al', 'node_modules'])
.stderr();
console.log(ls)