-
Notifications
You must be signed in to change notification settings - Fork 30
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
Support Dockerfiles found at URL #11
Comments
Can't you do a wget first for above dockerfile. You can do wget even within your own dockerfile. |
@aagrawa3-dev, if I am following you correctly:
Indeed you can fetch arbitrary content as part of your external-to-docker build script and then pass that content into the curl https://raw.githubusercontent.com/my/project/my-branch-name/my/directory/path/dockerfile \
| docker build --file - my-dir However, as far as I am aware it would not let you include multiple Dockerfiles from multiple fetch requests out-of-the-box. The thing that I like about I have not messed around with # syntax=edrevo/dockerfile-plus:0.1
FROM scratch
INCLUDE+ common-1.dockerfile
INCLUDE+ common-2.dockerfile
INCLUDE+ common-3.dockerfile
RUN echo "my extension on top of the common files above"
Not sure I know what you mean by this, can you elaborate more or provide an example of how I could (1) fetch a Dockerfile from GitHub for example and then (2) add that code from the fetched Dockerfile to
Fetching Dockerfiles from online sources is supported by the |
Hi @1Mill,
So, you fetch the dockerfile before including it. Let me know if that works for you!! |
@aagrawa3-dev, I do not believe the above works because I experimented with the below but always got the "could not read file" (i.e. could not find file) error: # syntax=edrevo/dockerfile-plus:0.1
FROM alpine:3
RUN apk --no-cache add curl
RUN curl \
--create-dirs \
--output /tmp/common.dockerfile \
https://raw.githubusercontent.com/1Mill/lambda-docker/main/nodejs/v14/2021-09-02/dockerfile
INCLUDE+ /tmp/common.dockerfile failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc error: code = Code(128) desc = Could not read file " /tmp/common.dockerfile". Remember that the file path is relative to the build context, not the Dockerfile path. |
@1Mill Yes I agree to this. That is a real issue then. Do you see an issue running a script before calling docker-build? |
@aagrawa3-dev, there are a handful of Docker pre-processors out there that do that kind of fetching and merging without the need for However, as we have discovered a major limitation of Really, the motivation for having |
Overview
This tool only appears to work within the Docker build context which is limited to wherever you run the
docker build my-dir
command. It would be awesome if we could do something liketo support Dockerfiles outside of the Docker build context.
The text was updated successfully, but these errors were encountered: