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
Saved Image Missing RepoTags #201
Comments
Hesitate to claim this ugly hack, but... if anyone gets to this issue via Google search, probably using this as a stopgap workaround: ---
resource_types:
- name: gcs-resource
type: docker-image
source:
repository: frodenas/gcs-resource
resources:
- name: tiller-image
type: docker-image
source:
repository: gcr.io/kubernetes-helm/tiller
tag: "v2.8.2"
- name: output-test
type: gcs-resource
source:
bucket: temp-delete
regexp: image.tar
json_key: {....}
jobs:
- name: image-test
plan:
- aggregate:
- get: tiller-image
params:
save: true
- task: do-test
config:
inputs:
- name: tiller-image
outputs:
- name: out
platform: linux
image_resource:
type: docker-image
source:
repository: <some image with python and bash>
run:
path: bash
args:
- -exc
- |
pushd tiller-image
mkdir -p new-image out
pushd new-image
tar -xvf ../image
popd
cp new-image/manifest.json manifest.json.bk
echo '
import json
with open("repository") as repo_file:
repo = repo_file.read().strip()
with open("tag") as tag_file:
tag = tag_file.read().strip()
with open("new-image/manifest.json", "r+") as file:
manifest = json.load(file)
repo_tags = ["{}:{}".format(repo, tag)]
manifest[0]["RepoTags"] = repo_tags
new_manifest = json.dumps(manifest)
file.seek(0)
print("\n", new_manifest, "\n")
file.write(new_manifest)
' > fix_manifest.py
python fix_manifest.py
tar -cvf ../out/new-image.tar -C new-image $(ls new-image)
- put: output-test
params:
file: out/new-image.tar |
I've been bitten by this too. docker-image-resource/assets/in Line 56 in 9e07b92
And the behavior described here: moby/moby#3877 Thx for the workaround. |
Unfortunately we have to use Giving that moby/moby#3877 is closed and solution is available if one wants to have the repo & tag saved in output image, i will closing this issue now. |
This seems a bit related to #78, but isn't the same issue.
When I do a
docker save
, themanifest.json
in thetar
file includes a populatedRepoTags
array. For example, after runningthe tarball has:
In contrast, the
/image
file in concourse has an emptyRepoTags
:/tag
is correctly populated: unlike #78, and I am specifying a concrete version.The
docker load
command uses that manifest's metadata, such that using the image saved via docker's cli:results in an image with proper repository and tag:
but loading an image generated via concourse does not.
Example pipeline used to test:
The text was updated successfully, but these errors were encountered: