Closed revsmadap closed 3 months ago
I see same issue on Linux machine.
@revsmadap read this, pls: https://stackoverflow.com/questions/74559925/dockerfile-parse-error-line-63-unknown-flag-link
I mean, that I think. the problem not in micronaut gradle plugin or dockerfile format.
This can happen on older Docker versions which do not support the --link
flag. An easy workaround is to use:
tasks.withType(io.micronaut.gradle.docker.MicronautDockerfile).configureEach { useCopyLink = false }
tasks.withType(io.micronaut.gradle.docker.NativeImageDockerfile).configureEach { useCopyLink = false }
I mean, that I think. the problem not in micronaut gradle plugin or dockerfile format.
Thank you @altro3. I understand that. I read the above stack overflow thread. As the Dockerfile is auto generate, could not enabled or set # syntax=docker/dockerfile:1.4
. or export BUILD_KIT=1
.
I have tried seeing the source code, but could not place to set these options.
This can happen on older Docker versions which do not support the
--link
flag. An easy workaround is to use:tasks.withType(io.micronaut.gradle.docker.MicronautDockerfile).configureEach { useCopyLink = false } tasks.withType(io.micronaut.gradle.docker.NativeImageDockerfile).configureEach { useCopyLink = false }
Thank you @melix. Will try these options.
Thanks @melix. It works.
I have following queries
tasks.named("dockerBuild"){
imageName = "${dockerRegistryName}/${imageName}:${dockerVersion}"
//name = "${dockerRegistryName}/${imageName}:${dockerVersion}"
}
tasks.named("dockerfile") {
args("ARGS JAR_FILE")
// args = ["ARGS JAR_FILE"]
}
Thanks @melix. It works.
I have following queries
- How can I change the image name? I tried the following, I have defined dockerRegistryName, imageName in the build.gradle
tasks.named("dockerBuild"){ imageName = "${dockerRegistryName}/${imageName}:${dockerVersion}" //name = "${dockerRegistryName}/${imageName}:${dockerVersion}" }
I'm able to solve this issue.
Expected Behavior
No response
Actual Behaviour
Hi,
I have create a simple hello world application. Trying to dockerize it using dockerBuild gradle task. But fails with
Status 400: {"message":"dockerfile parse error line 3: Unknown flag: link"}
Stacktrace:
Dockerfile (generated):
Steps To Reproduce
Following are the step
/sayHello
context pathEnvironment Information
Machine Details Apple M1 Pro Version 14.3.1 (23D60)
Java Info JAVA_VERSION=17.0.7, JAVA_VENDOR=Oracle Corporation, RUNTIME_NAME=Java(TM) SE Runtime Environment, RUNTIME_VERSION=17.0.7+8-LTS-224, VM_NAME=Java HotSpot(TM) 64-Bit Server VM, VM_VERSION=17.0.7+8-LTS-224, VM_VENDOR=Oracle Corporation, OS_ARCH=aarch64
Docker Info: `Client: Context: default Debug Mode: false Plugins: buildx: Docker Buildx (Docker Inc., v0.8.2) compose: Docker Compose (Docker Inc., v2.5.1)
Server: Containers: 54 Running: 0 Paused: 0 Stopped: 54 Images: 162 Server Version: 20.10.16 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true userxattr: false Logging Driver: json-file Cgroup Driver: cgroupfs Cgroup Version: 1 Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc Default Runtime: runc Init Binary: docker-init containerd version: 3df54a852345ae127d1fa3092b95168e4a88e2f8 runc version: init version: Security Options: seccomp Profile: default Kernel Version: 5.15.40-0-virt Operating System: Alpine Linux v3.15 OSType: linux Architecture: aarch64 CPUs: 4 Total Memory: 9.704GiB Name: lima-rancher-desktop ID: PLGR:LDZG:NHVJ:7Z6B:NAWQ:3REN:NYUV:3HMW:N3ZS:4HA7:XAJO:OFNY Docker Root Dir: /var/lib/docker Debug Mode: false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false`
Example Application
No response
Version
4.3.4