Comments (4)
@aburnett So the Dockerfile command should be ADD /opt/apps/spar-api.tar.gz /opt/apps/
?
from docker-maven-plugin.
Hi,
According to the docker docs, an ADD is supposed to copy and unpack if in a recognized format. If you want to have a copy of the tar.gz in the resulting image, a copy command should be used.
REF: https://docs.docker.com/reference/builder/#add
• If is a local tar archive in a recognized compression format (identity, gzip, bzip2 or xz) then it is unpacked as a directory. Resources from remote URLs are not decompressed. When a directory is copied or unpacked, it has the same behavior as tar -x: the result is the union of:
- Whatever existed at the destination path and
- The contents of the source tree, with conflicts resolved in favor of “2.” on a file-by-file basis.
REF: http://stackoverflow.com/questions/24958140/docker-copy-vs-add
You should check the ADDhttp://docs.docker.com/reference/builder/#add and COPYhttp://docs.docker.com/reference/builder/#copy documentations for an exhaustive description of their behaviours, but in a nutshell the major difference is that ADD can do more than COPY:
- ADD allows to be an URL
- If the parameter of ADD is an archive in a recognised compression format, it will be unpacked
Chris Snider
Senior Software Engineer
Intelligent Software Solutions, Inc.
[Description: Description: Description: cid:[email protected]]
From: David Xia [mailto:[email protected]]
Sent: Wednesday, August 12, 2015 7:48 AM
To: spotify/docker-maven-plugin [email protected]
Subject: Re: [docker-maven-plugin] ADD command incorrect for tar.gz files (#123)
@aburnetthttps://github.com/aburnett So the Dockerfile command should be ADD /opt/apps/spar-api.tar.gz /opt/apps/?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/123#issuecomment-130312306.
from docker-maven-plugin.
Yea I saw that. I think we all agree that ADD unpacks tar archives. The question is whether this plugin should be smart about tar files and instead of naively writing ADD /opt/apps/spar-api.tar.gz /opt/apps/spar-api.tar.gz
write ADD /opt/apps/spar-api.tar.gz /opt/apps/
instead so that the contents of the archive aren't nested in a misleadingly named parent folder.
from docker-maven-plugin.
@chris-snider that's correct about copy/add. I'm going for copy+unpack so ADD is correct.
@davidxia ya, that's what I think the command should be. Perhaps the easiest solution is to just pass targetPath
verbatim as the last argument to ADD
. Then the behavior would match the docs and you wouldn't have to get fancy in the plugin.
from docker-maven-plugin.
Related Issues (20)
- Not working with jdk11 HOT 4
- Failed to execute goal com.spotify:docker-maven-plugin:1.2.0:build HOT 5
- Problem connecting to Docker on Vagrant HOT 1
- 推送镜像至私服时,即使设置的imageTag,仍然会生成一个latest的tag,且两个tag的镜像id相同,如何设置才能覆盖latest的tag而只生成自己设置的tag呢 HOT 2
- how can i get git commit Id in lables
- =>
- Show Sending build context to Docker daemon ***GB HOT 1
- com.spotify.docker.client.shaded.org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyReader not found for media type=text/html HOT 3
- k8s gitlab runner dose not work with docker maven plugin
- Authentication usernamenot support chinese HOT 1
- Support for Red Hat Enterprise Linux 8? HOT 1
- Can this plugin be used to publish docker image to docker.pkg.github.com HOT 1
- Status? HOT 1
- Schema specific part is opaque HOT 1
- Failed to execute goal com.spotify:docker-maven-plugin:1.0.0:build (default-cli) on project HOT 3
- Remote DOCKER_HOST configuration does not work with ssh protocol HOT 3
- How to building Docker Image in Maven Project of multi-module HOT 2
- gitlab ci not execute deploy with docker maven plugin HOT 1
- push image to registry fail HOT 1
- I am using docker maven plugin and I made intentionally error in application (bean creation exception) but always I am getting error in generic was saying Docker IO error [ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.32.0:start (docker-start) on project captcha-validator-integration-test: I/O Error: [***.azurecr.io/ssib/captcha-validator-service:1.2.0-SNAPSHOT] "service-captcha-validator": Timeout after 120460 ms while waiting on log out 'Started CaptchaValidatorApplication' -> [Help 1] [ERROR] [ERROR] How to display actual error in logs?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-maven-plugin.