Comments (4)
Have you looked into the IMPORT
command?
You can have a base target like:
VERSION 0.8
common-alpine-target:
FROM alpine:3.18
RUN echo "this should be available everywhere" > /common-data
Then import a parent Earthfile in some child directory like:
VERSION 0.8
IMPORT .. AS root
child:
FROM root+common-alpine-target
RUN cat /common-data
then you can treat common-alpine-target
as a golden base image which everything should depend on.
from earthly.
unfortunately IMPORT
doesn't allow you to import any ARG
or LET
definitions; but I could see this being a nice addition (especially if we add a CONST
one day #1863)
from earthly.
unfortunately
IMPORT
doesn't allow you to import anyARG
orLET
definitions; but I could see this being a nice addition (especially if we add aCONST
one day #1863)
I actually figured out that I could use FROM with targets, but having a way to share variables could be useful for someone else. I'm currently satisfied with my solution, but maybe I should keep this issue open for the ones who might benefit from this?
from earthly.
it's also possible to inherit a ENV
value from a different target (where as ARG
values are not inherited)
from earthly.
Related Issues (20)
- unable to use `--buildkit-container-name` to have released earthly cli connect to local dev version of buildkit
- RUN --ssh not work HOT 1
- `WITH DOCKER` breaks with `EARTHLY_DOCKERD_CACHE_DATA: parameter not set`
- GHA Build Summary integration not supporting colors
- Remote registry cache & cache mounts HOT 3
- how can i inspect every stage cost time
- `WITH DOCKER --cache-id` does not expand the `--cache-id` value HOT 7
- Cache with higher precision timestamps HOT 1
- `RUN --raw-output` doesn't work `WITH DOCKER` HOT 1
- less verbose `failed to parse key scan "this-is-a-bad-entry": invalid keyscan` errors
- Create matrix builds from CLI arguments HOT 1
- `RUN --interactive` triggers HTTP 500 when used `WITH DOCKER --load` HOT 1
- Can I `COPY` artifacts from a matrix build? HOT 2
- `--pass-args` busts cache unexpected HOT 8
- DIND networking dont work when using non standard CNI_MTU
- `TRY` / `FINALLY` when used with `WITH DOCKER` produces verbose output HOT 2
- Earthly doesn't respect a host defined in a local `/etc/hosts` file when doing SAVE IMAGE
- ticktock cache issue HOT 2
- `TRY` / `FINALLY` doesn't work under `WITH DOCKER`
- error message for WITH DOCKER (unlazy force execution) could be improved
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from earthly.