Need to get "created" date in crictl images - List images call - containerd

Need to add CreateDate column in the below output as like we get in docker images but unable to figure out a good way. --help also doesn't seem to show suitable option to consider for my requirement.
root#ip-10-xx-x-xxx:/home/ubuntu# crictl images --help
NAME:
crictl images - List images
USAGE:
crictl images [command options] [REPOSITORY[:TAG]]
OPTIONS:
--digests Show digests (default: false)
--no-trunc Show output without truncating the ID (default: false)
--output value, -o value Output format, One of: json|yaml|table
--quiet, -q Only show image IDs (default: false)
--verbose, -v Show verbose info for images (default: false)
--help, -h show help (default: false)
root#ip-10-xx-x-xxx:/home/ubuntu# crictl images
IMAGE TAG IMAGE ID SIZE
docker.io/library/mongo latest dfda7a2cf2734 248MB
docker.io/library/postgres latest cdbebe091601b 137MB
docker.io/library/ubuntu latest ba6acccedd292 28.6MB
docker.io/qualys/sensor 1.11.0 98a327bec6273 669MB

Related

How to add telemetry data from a video to jpg file?

I have a 360deg video that is created by Go Pro Fusion and has telemetry data in it. I want to extract the telemetry data and put inside of jpg file.
I am extracting images using ffmpeg:
ffmpeg -i VIDEO.mp4 -r 5 img%d.jpg
How can i extract metadata(including telemetry data) for each frame and put that metadata inside jpg image of that frame.
I tried using
exiftool -ee -a -u -U -TagsFromFile video.mp4 img1.jpg
But all the metadata that appear in video does not appear in image.
I tried this:
exiftool -track1:VideoFrameRate=29.97 img1.jpg
But getting this warning:
Warning: Sorry, Track1:VideoFrameRate doesn't exist or isn't writable
Nothing to do.
<Track1:VideoFrameRate>20.00</Track1:VideoFrameRate>
I get this from video. But unable to set in jpg as mentioned above.
And how to ensure that the images are assigned with the exact GPS data?

how to tag a docker image using an environment variable

i've discovered that instead of unzipping a .tar.gz file, i am better off loading it:
- name: Load image
run: docker load -i pga.tar.gz
for some reason, it does not come with a name - so i need to extract the id...the only way i've seen that is possible:
- name: Get image id
run: imageid=$(docker images --format="{{.ID}}" | head -n 1); echo "$imageid"
what i get for that part looks good:
Run imageid=$(docker images --format="{{.ID}}" | head -n 1); echo "$imageid"
fc6e040841a1
but when i try to tag....
- name: Tag image
run:
docker tag $imageid
registry.digitalocean.com/abda-containers/abd_db:${{github.event.inputs.version }}
it gives me:
Run docker tag $imageid registry.digitalocean.com/abda-containers/abd_db:kk
docker tag $imageid registry.digitalocean.com/abda-containers/abd_db:kk
shell: /usr/bin/bash -e {0}
"docker tag" requires exactly 2 arguments.
See 'docker tag --help'.
Usage: docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
Error: Process completed with exit code 1.
not sure what to do..

Buildctl command to tag multiple images

I am using Buildkit to build and push the images. I would like to add multiple tags on the images in buildctl command. For eg
buildctl build --frontend=dockerfile.v0 --local context=. --local dockerfile=. --output=type=image,name=test/repo:tag1,test/repo:tag2,push=true
Above command fails. Please suggest how can i use buildctl command to tag the image with tag1 and tag2 and push it
Using exporter doesnt works it reports that exporter is deprecated
In order to tag and push multiple images (and/or tags), you have to escape the images:
buildctl build \
--frontend dockerfile.v0 \
--local context=. \
--local dockerfile=. \
--output type=image,\"name=test/repo:tag1,test/repo:tag2\",push=true

How to list the published container images in the Google Container Registry in a CLI in image size order

Using a CLI, I want to list the images in each repository in a Google Container Registry project but with the following conditions:
Lists the images with the latest tag only
Lists the human-readable size of the images
Lists the name of the images
The closest I've managed to get us through gsutil:
gsutil du -h gs://eu.artifacts.my-registry.appspot.com/containers/images
Resulting in:
33.77 MiB gs://eu.artifacts.my-registry.appspot.com/containers/images/sha256:03c1a2387ef6cb30a7428a46821f946d6a2c591a26cb2066891c55b2b6846ae2
1.27 MiB gs://eu.artifacts.my-registry.appspot.com/containers/images/sha256:03c1e7db6bf0140bd5fa34236a35453cb73cef01f6d89b98bc5995ae8ea07aaf
1.32 KiB gs://eu.artifacts.my-registry.appspot.com/containers/images/sha256:03c3c97495d60c68d37d04a7e6c9b3a48bb159ce5dde13d0d81b4e75e2a3f1d4
81.92 KiB gs://eu.artifacts.my-registry.appspot.com/containers/images/sha256:03c5483cb8ac9c9ae498507e15d68d909a11859a8e5238556b7188e0af4d9264
457.43 KiB gs://eu.artifacts.my-registry.appspot.com/containers/images/sha256:03c7f98faa1cfc05264e743e23ca2e118d24c57bfd67d5cb2e2c7a57e8124b6c
7.88 KiB gs://eu.artifacts.my-registry.appspot.com/containers/images/sha256:03c83b13d044844cd3f6b278382e408541f22029acaf55d9e7e5689b8d51eeea
But obviously this does not meet most of my criteria.
The information is available through the GUI like so on a per image basis:
Any ideas?
I'm open to gsutil, gcloud, docker, anything really which can be installed on a docker container.
You can use the Google Cloud UI to accomplish this. There's a column selector right next to the filter bar and it has an option for the image size.
Once the column is displayed, you'll be able to order by size.
Its seems you have only one outstanding issue with listing container images size after reading your comment at Jason's answer. So it is not possible to retrieve with gcloud command directly. Here are two work around I tested:
You can use gcloud container images describe command to see the size of the images. Make sure you use "--log-http" flag with it. Command should be like this:
$ gcloud container images describe gcr.io/myproject/myimage:tag --log-http
Another way to get the size of the image is using gsutil stat command.
So here's what I did:
a. Upon running below command, I listed all my images from the GCS bucket and saved it to a file called images.txt
$ gsutil ls "BUCKET URL" > images.txt
b. I ran gcloud stat command like below to read image names from the images.txt file and return size of the images chronologically.
$ for x in $(cat images.txt); do `gsutil stat $x | grep Content-Length | awk '{print $2}'`; done
You can customize this little script according to your need.
I understand these are not efficient workaround but thats all seems to be an option now. However, GCR just implements the docker container API, so may be you can read this document to see if you can find/do something of your own.
Hi here just to share a rudimental script which takes the first tag and get the size of the whole layers and write it on a report, it takes ages on 3TB repo but at least i know which repo is big.
echo "REPO,SIZE" > repository-size-report.csv
for REPO in $(gcloud container images list --repository eu.gcr.io/comerge-comerge01-171833 --format="table[no-heading](NAME)") ; do
for TAGS in $(gcloud container images list-tags $REPO --format="table[no-heading](TAGS)"); do
TAG=$(echo $TAGS | cut -d, -f1)
SUM=0
for SIZE in $(gcloud container images describe $REPO:$TAG --log-http 2>&1 | grep size | grep -o '[0-9][0-9]*') ; do
SUM=$((SUM + SIZE))
done
HSUM=$(echo $SUM | numfmt --to iec --format "%8f")
echo "$REPO:$TAG,$HSUM"
echo "$REPO:$TAG,$HSUM" >> repository-size-report.csv
done
done
You can use the command gcloud container images list command to accomplish this task; however, you will need to set the appropriate flags to fulfill your use case. You can read more about the command and the flag options here.

Download GD-JPEG image with correct dimensions from cURL CLI

I need help in downloading a series of GD generated images with their correct dimensions.
I'm using this command in the cURL CLI to download a range of items:
curl "http://apl-moe-eng-www.ai-mi.jp/img/php/fitsample.php?&i_id=4[0001-9999]" -o "Clothes\4#1.jpg" --create-dirs
But the downloaded image's dimensions are smaller than the one shown on the website. The website's image's dimensions are 640*882, but cURL's output image's dimensions are 232*320.
Original Image
cURL Output Image
Why is this, and can anything be added to the command to fix this?
I figured out it was because I left out a user agent:
curl "http://apl-moe-eng-www.ai-mi.jp/img/php/fitsample.php?&i_id=4[0001-9999]" -o "Clothes\4#1.jpg" --create-dirs --user-agent "Android"
Odd, huh?

Resources