Open CluEleSsUK opened 2 weeks ago
The generated dockerfile looks like so:
#### Installs moon.
FROM node:latest AS base
WORKDIR /app
# Install moon binary
RUN curl -fsSL https://moonrepo.dev/install/moon.sh | bash
ENV PATH="/root/.moon/bin:$PATH"
#### SKELETON STAGE
#### Scaffolds repository skeleton structures.
FROM base AS skeleton
# Copy entire repository and scaffold
COPY . .
RUN moon docker scaffold hose
#### BUILD STAGE
#### Builds the project.
FROM base AS build
# Copy toolchain
COPY --from=skeleton /root/.proto /root/.proto
# Copy workspace configs
COPY --from=skeleton /app/.moon/docker/workspace .
# Install dependencies
RUN moon docker setup
# Copy project sources
COPY --from=skeleton /app/.moon/docker/sources .
# Build the project
RUN moon run hose:build
# Prune extraneous dependencies
RUN moon docker prune
#### START STAGE
#### Runs the project.
FROM base AS start
# Copy built sources
COPY --from=build /root/.proto /root/.proto
COPY --from=build /app /app
ENTRYPOINT node /app/index.js
I added the last ENTRYPOINT, but that shouldn't change anything
fwiw I have also tried npm install -g @moonrepo/cli
instead of the curl->bash, but that gives me
> [build 5/6] RUN moon run hose:build:
0.213 Error: project::task::unknown
0.213
0.213 × Unknown task build for project hose.
0.213 help: Has this task been configured?
0.213
This task runs no problem outside docker
Yeah that panic basically means there are no actions in the pipeline: https://github.com/moonrepo/moon/blob/master/crates/action-pipeline/src/action_pipeline.rs#L140
Something isn't right in the Dockerfile. Seems like critical config files are missing.
If you run moon docker scaffold
outside of docker, does the shape of .moon/docker
look correct?
hmm it does not, it contains my package.json, moon.yml, tsconfig.json and .gitignore (but no source directories). This sort of aligns with the build task except the glob:
language: 'typescript'
tasks:
build:
command: 'npm run build'
inputs:
- 'src/**/*'
- 'tsconfig.json'
- 'package.json'
outputs:
- 'index.js'
ah sorry, the source dir is under .moon/docker/sources/$project
🤡
Can you pass --log trace
to moon docker setup
and then paste the logs?
Also, .dockerignore
looks fine yeah?
Describe the bug
I generated a dockerfile using
moon docker file <project>
. Building the resulting dockerfile panicsSteps to reproduce
moon docker setup projectName
docker build -f path/to/Dockerfile .
Expected behavior
dockerfile builds
Screenshots
Environment
Additional context