You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit enables the use of Skopeo to pull container images.
Skopeo uses the OCI schema version 2 to fetch container images.
It lays out the images on disk differently than Docker after a pull.
In order to enable analysis of containers pulled in this way, this PR
introduces the OCIImage class which reflects the expected layout.
In order to deal with the different expected directory structures, we
move a commonly used function in rootfs.py, get_untar_dir(), to the
ImageLayer class, and creates a new property called 'image_layout'.
In this way, container image layouts on disk can be dealt with based
on derived Image classes.
We also introduce the OCIImage class and changes to the
DockerImage class which makes use of the new ImageLayer property
and method. We replace all instances of get_untar_dir() with the
ImageLayer instance's get_untar_dir() method. We connect all
the pieces from the command line option to the image extraction method.
Finally, we add Skopeo to the list of requirements for Tern in the
documentation, Dockerfiles and the development environments.
Lastly, we deal with the different image dictionary layouts
based on the image layout in the html report specifically.
Fixes#948
Signed-off-by: Nisha K <nishak@vmware.com>
- skopeo (See [here](https://github.com/containers/skopeo/blob/main/install.md) for installation instructions or building from source)
73
73
74
-
Some distro versions have all of these except `attr`and/or `jq` preinstalled but both are common utilities and are available via the package manager.
74
+
Some distro versions have all of these except `attr`, `jq`, and/or `skopeo` preinstalled. `attr` and `jq`are common utilities and are available via the package manager. `skopeo` has only recently been packaged for common Linux distros. If you don't see your distro in the list, your best bet is building from source, which is reasonably straightforward if you have Go installed.
75
75
76
-
For Docker containers
76
+
For analyzing Dockerfiles and to use the "lock" function
77
77
- Docker CE (Installation instructions can be found here: https://docs.docker.com/engine/installation/#server)
78
78
79
-
Make sure the docker daemon is running.
79
+
*NOTE:* We do not provide advice on the usage of [Docker Desktop](https://www.docker.com/blog/updating-product-subscriptions/)
80
+
81
+
Once installed, make sure the docker daemon is running.
## Getting Started with Docker<aname="getting-started-with-docker">
106
-
Docker is the most widely used tool to build and run containers. If you already have Docker installed, you can run Tern by building a container with the Dockerfile provided and the `docker_run.sh` script:
108
+
Docker is the most widely used tool to build and run containers. If you already have Docker installed, you can run Tern by building a container with the Dockerfile provided.
Run the script `docker_run.sh`. You may need to use sudo. In the below command `debian` is the docker hub container image name and `buster` is the tag that identifies the version we are interested in analyzing.
137
+
Run the ternd container image
138
+
139
+
```
140
+
$ docker run --rm ternd report -i debian:buster
141
+
```
142
+
143
+
If you are using this container to analyze Dockerfiles and to use the "lock" feature, then you must volume mount the docker socket. We have a convenience script which will do that for you.
You can make this change to the `docker_run.sh` script to make it easier.
163
+
155
164
## Getting Started with Vagrant<aname="getting-started-with-vagrant">
156
165
Vagrant is a tool to setup an isolated virtual software development environment. If you are using Windows or Mac OSes and want to run Tern from the command line (not in a Docker container) this is the best way to get started as Tern does not run natively in a Mac OS or Windows environment at this time.
0 commit comments