-1

A similar question as Can I run an intermediate layer of docker image?, but the answers are for the image which you need build it locally.

My question is, I don't need docker run the intermediate layer, I can only pull the image from public registry server, such as hub.docker.com.

For example, for the history (layers) of an image like this:

$ docker pull ruby
Using default tag: latest
latest: Pulling from library/ruby
e9afc4f90ab0: Already exists
989e6b19a265: Already exists
af14b6c2f878: Already exists
5573c4b30949: Already exists
11a88e764313: Pull complete
7bab57a324dc: Pull complete
0d7deb43995d: Pull complete
4315356f2eff: Pull complete
Digest: sha256:c750baf8de6d180aa48915655b79c35d93ef5665339860c1d608cb33e2ae873e
Status: Downloaded newer image for ruby:latest
docker.io/library/ruby:latest

can I get a tar from layer id 11a88e764313?

Updates

I pulled the latest ruby image, the answer with docker save doesn't work

$ docker save -o layer.tar 11a88e764313
Error response from daemon: No such image: 11a88e764313
Bill
  • 2,494
  • 5
  • 26
  • 61
  • Does this answer your question? [Can I run an intermediate layer of docker image?](https://stackoverflow.com/questions/42602731/can-i-run-an-intermediate-layer-of-docker-image) Maybe try extrapolating what's mentioned there like: `docker save -o image.tar 168cf3f33330` – jbielick Jul 08 '20 at 02:59
  • How do you know that you need this specific layer ? Layer is nothing but the result of an instruction of a Dockerfile...so why not just take this specific instruction and including it in your own dockerfile ? – jossefaz Jul 10 '20 at 00:31

1 Answers1

-1

Docker save should work.

docker save -o myimage.tar 168cf3f33330

jbielick
  • 2,800
  • 17
  • 28