-
-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new: Disable caching in Docker containers. (#306)
* Add docker check. * Add docker page. * Add workdir. * Wrap in strings. * Check for VCS instead. * Move logic. * Update setup. * Fix workflow.
- Loading branch information
Showing
22 changed files
with
123 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
crates/cli/tests/snapshots/run_node_test__handles_process_exit_code_zero.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
crates/cli/tests/snapshots/run_node_test__handles_process_exit_zero.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
crates/cli/tests/snapshots/run_node_test__inherits_moon_env_vars.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
crates/cli/tests/snapshots/run_node_test__runs_from_project_root.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
crates/cli/tests/snapshots/run_node_test__runs_from_workspace_root.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
crates/cli/tests/snapshots/run_node_test__runs_package_managers.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
crates/cli/tests/snapshots/run_node_test__runs_standard_script.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
crates/cli/tests/snapshots/run_node_test__supports_top_level_await.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
title: Docker usage | ||
--- | ||
|
||
Using [Docker](https://www.docker.com/) to run your applications? Or build your artifacts? No | ||
worries, moon can be utilized with Docker! For the most part, everything should just work, but we | ||
have disabled caching and hashing in Docker containers and images for the following reasons: | ||
|
||
- Avoids having to mount a volume for the `.git` directory. | ||
- Reduces the overall image size as we're avoiding creating tarballs. | ||
- Ensures that builds are fresh and up-to-date. | ||
|
||
:::success | ||
|
||
Looking to speed up your Docker builds? Want to build in the cloud? | ||
[Give Depot a try](https://depot.dev?ref=moonrepo)! | ||
|
||
::: | ||
|
||
## Dockerfile | ||
|
||
This is merely an example of using moon within a `Dockerfile` while taking advantage of its layer | ||
caching. The final 2 steps should be customized to your project's needs! | ||
|
||
```docker | ||
FROM node:latest | ||
WORKDIR /app | ||
# Install moon binary | ||
RUN npm install -g @moonrepo/cli | ||
# Copy moon files | ||
COPY ./.moon ./.moon | ||
# Copy all package.json's and lockfiles | ||
COPY ... | ||
COPY ./package.json ./package.json | ||
COPY ./yarn.lock ./yarn.lock | ||
# Install toolchain and dependencies | ||
RUN moon setup | ||
# Copy project and required files | ||
COPY ./app/example/project ./app/example/project | ||
COPY ... | ||
# Run target | ||
CMD ["moon", "run", "project:task"] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.