Coder Social home page Coder Social logo

Docs: dependsOn to files about gradle-docker HOT 4 CLOSED

palantir avatar palantir commented on September 22, 2024
Docs: dependsOn to files

from gradle-docker.

Comments (4)

uschi2000 avatar uschi2000 commented on September 22, 2024

Hej. We removed some of the hidden/magical configuration with the goal of making the docker build context easier to understand. The contract is: the plugin copies the declared docker.dockerfile as well as all files declared via the docker.files copyspec:

            prepare.with {
                with ext.copySpec
                from(ext.resolvedDockerfile) {
                    rename { fileName ->
                        fileName.replace(ext.resolvedDockerfile.getName(), 'Dockerfile')
                    }
                }
                into dockerDir
            }

So what you're doing looks good. I don't quite follow what you mean by My config now looks like below, with everything below src/main/resources in the build/docker directory, ideally I'd like them in build/docker/src/main/resources/ ..., can you elaborate?

from gradle-docker.

damianoneill avatar damianoneill commented on September 22, 2024

Hi Robert thanks for coming back so quickly.

This was my previous directory structure

build/docker/src/main/resources/someresources

Now its

build/docker/someresources

Ideally I'd like a way to maintain the 'src/main/resources' part of what gets copied across.

I wasn't sure if there was tasks.xxx.xxx option that could be used for src/main/resources or some other gradle mechanism.

Apologies I'm not a gradle expert.

from gradle-docker.

uschi2000 avatar uschi2000 commented on September 22, 2024

I see you can get access to the underlying copyspec via docker.copySpec and do something like this (untested, syntax is probably a bit broken, but you get the idea):

docker {
    name "app:${project.version}"
    files tasks.jar.outputs, tasks.bootRepackage.outputs
}
docker.copySpec
  .from('src/main/resources')
  .into('src/main/resources')

see https://docs.gradle.org/current/userguide/working_with_files.html

from gradle-docker.

uschi2000 avatar uschi2000 commented on September 22, 2024

Closing for now, let me know if that doesn't work.

from gradle-docker.

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.