Git Product home page Git Product logo

Comments (12)

ankitjain28may avatar ankitjain28may commented on June 14, 2024

I can take this issue.

from publish-docker-github-action.

elgohr avatar elgohr commented on June 14, 2024

Maybe I don't get it correct, but why wouldn't you do workdir: ..? https://github.com/elgohr/Publish-Docker-Github-Action/blob/master/README.md#workdir

from publish-docker-github-action.

ankitjain28may avatar ankitjain28may commented on June 14, 2024
- abc (folder)
|- Dockerfile
|- xyz (build context for Dockerfile)
|- blah blah..
|- important stuff
|- Dockerfile2
|- xyz2 (build context for Dockerfile2)

Incase of workdir, we wont be able to left xyz2 folder, so in case of build context argument, we can define abc as the workdir and specify Dockerfile along with build context. Hope it makes sense.

from publish-docker-github-action.

elgohr avatar elgohr commented on June 14, 2024

Sorry, I don't get it.
The checkout would get abc, as that's the root. So there wouldn't be the need for workdir: .. anyway. You can define the Dockerfile by https://github.com/elgohr/Publish-Docker-Github-Action/blob/master/README.md#dockerfile , which can reference the files in xyz or xyz2.

from publish-docker-github-action.

ankitjain28may avatar ankitjain28may commented on June 14, 2024

Please read this-> https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#understand-build-context
You will get a better idea about why it is required.

from publish-docker-github-action.

elgohr avatar elgohr commented on June 14, 2024

Ok, let me sum this up.
There are multiple Dockerfiles inside a repository.
We want to build one of them and avoid sending the unneeded resources, which are probably needed by another Dockerfile, to the deamon.
We can't use .dockerignore , because this would also affect the other Dockerfiles builds.
So why can't we have

- abc (folder)
|- xyz (build context for Dockerfile)
|-- Dockerfile
|- xyz2 (build context for Dockerfile2)
|-- Dockerfile2

and use workdir ?

I would like to avoid as much magic as possible...

from publish-docker-github-action.

ankitjain28may avatar ankitjain28may commented on June 14, 2024

If I change the change the workdir to xyz, it wont be able to find the location of Dockerfile as it is in the parent dir to xyz.

from publish-docker-github-action.

elgohr avatar elgohr commented on June 14, 2024

So what limits you from moving it into xyz?

from publish-docker-github-action.

ankitjain28may avatar ankitjain28may commented on June 14, 2024

Well, that's not actually a solution. There are cases where such scenarios occur and because of that docker has provided a build-context feature.

from publish-docker-github-action.

elgohr avatar elgohr commented on June 14, 2024

Could you please make an example where this wouldn't be a solution?

from publish-docker-github-action.

Lybecker avatar Lybecker commented on June 14, 2024

I would like this feature too

from publish-docker-github-action.

elgohr avatar elgohr commented on June 14, 2024

There you go https://github.com/elgohr/Publish-Docker-Github-Action/releases/tag/2.9
https://github.com/elgohr/Publish-Docker-Github-Action#context

from publish-docker-github-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.