Skip to content
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

Gradle Kotlin DSL migration instructions #488

Open
daggerok opened this issue Oct 5, 2021 · 1 comment
Open

Gradle Kotlin DSL migration instructions #488

daggerok opened this issue Oct 5, 2021 · 1 comment

Comments

@daggerok
Copy link

daggerok commented Oct 5, 2021

What happened?

I cannot find any build.gradle -> build.gradle.kts migration instructions...

What did you want to happen?

Can anybody suggest me, how can I migrate that build file to Kotlin DSL?

plugins {
    id "com.palantir.docker-run"
}

dockerRun {
    name 'rabbitmq'
    image 'rabbitmq:3.8.16-management-alpine'
    ports '5672:5672', '15672:15672'
    env 'RABBITMQ_DEFAULT_USER': 'guest',
        'RABBITMQ_DEFAULT_PASS': 'guest',
        'MYVAR2': 'MYVALUE2'
    daemonize true
    clean true
}

tasks.register('up') {
    dependsOn('dockerRun')
}

tasks.register('down') {
    dependsOn('dockerStop', 'dockerRemoveContainer')
}

dockerRemoveContainer.dependsOn('dockerStop')
dockerRemoveContainer.mustRunAfter('dockerStop')

Thanks!


Regards,
Maksim

@AnakinPt
Copy link

I have this simple script to build a docker image and push it to AWS ECR. I hope this will help you this helps you?

plugins {
    id("com.palantir.docker") version "0.27.0"
}

docker {
    tag("awsTestLatest", "<awsaccount>.dkr.ecr.eu-central-1.amazonaws.com/grafana:latest")

    name = "${project.name}"

    setDockerfile(file("Dockerfile"))
}

tasks {

    register<Copy>("copyEntrypoint") {
        mustRunAfter(":dockerClean")
        from(listOf("src/main/resources/entry.sh"))
        into("build/docker")
    }

    named("docker") {
        dependsOn(
                ":copyEntrypoint"
        )
    }

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants