Skip to content

Commit

Permalink
updating git, curl, and ruby image READMEs (#2073)
Browse files Browse the repository at this point in the history
* updating git, curl, and ruby image READMEs

Signed-off-by: Mark Drake <mark@chainguard.dev>

* Resolving Lisa's suggestion

Signed-off-by: Mark Drake <mark@chainguard.dev>

---------

Signed-off-by: Mark Drake <mark@chainguard.dev>
  • Loading branch information
SharpRake authored Jan 24, 2024
1 parent d897e1e commit 563aeca
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 31 deletions.
20 changes: 9 additions & 11 deletions images/curl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,26 @@ docker pull cgr.dev/chainguard/curl:latest
<!--body:start-->
## Usage

The curl image allows you to run ordinary curl commands in CI/CD pipelines and also locally via Docker.
The curl Chainguard Image allows you to run ordinary `curl` commands in CI/CD pipelines as well as locally with Docker.

### Docker Setup

To make sure you have the latest image version available, start by running a `docker pull` command:
To make sure you have the latest version of the Image available, start by running a `docker pull` command:

```shell
docker pull cgr.dev/chainguard/curl
```

Then, run the image with the `--version` flag to make sure it is functional:
Then, run the image with the `--version` flag to make sure the Image is functional:

```shell
docker run -it --rm cgr.dev/chainguard/curl --version
```
You should get output similar to this:

This will return output similar to the following:

```shell
$ docker run curl --version
curl 7.87.0 (aarch64-unknown-linux-gnu) libcurl/7.87.0 OpenSSL/3.0.7 zlib/1.2.13 brotli/1.0.9 nghttp2/1.49.0
Release-Date: 2022-12-21
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli HSTS HTTP2 HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL threadsafe TLS-SRP UnixSockets
curl 8.5.0 (x86_64-pc-linux-gnu) libcurl/8.5.0 rustls-ffi/0.11.0/rustls/0.21.5 zlib/1.3 brotli/1.1.0 nghttp2/1.58.0
Release-Date: 2023-12-06
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli HSTS HTTP2 HTTPS-proxy IPv6 Largefile libz SSL threadsafe UnixSockets
```
<!--body:end-->
46 changes: 28 additions & 18 deletions images/git/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,38 +26,39 @@ docker pull cgr.dev/chainguard/git:latest
<!--getting:end-->

<!--body:start-->
## Usage

Note that this image also has a glibc version:
Note that there is also glibc version of this Image available:

```
docker pull cgr.dev/chainguard/git:latest-glibc
```

The Git image allows you to run ordinary Git commands in CI/CD pipelines and also locally via Docker.
## Usage

Chainguard's Git Image allows you to run ordinary Git commands in CI/CD pipelines and also locally via Docker.

### Docker Setup

To make sure you have the latest image version available, start by running a `docker pull` command:
To make sure you have the latest version of the Image available, start by running a `docker pull` command:

```shell
docker pull cgr.dev/chainguard/git
```

Then, run the image with the `--version` flag to make sure it is functional:
Then, run the Image with the `--version` flag to make sure the Image is functional:

```shell
docker run -it --rm cgr.dev/chainguard/git --version
```
You should get output similar to this:

You will receive output similar to this:

```
git version 2.37.1
git version 2.43.0
```

### Cloning a Repository Locally

Because your local system user's ID (uid) might differ from that of the container image, if you want to clone repositories locally using this image you'll need to set up special permissions for the target dir. Then, you'll be able to set up a volume and have the contents of the cloned repo replicated on your host machine.
Because your local system user's unique identifier might differ from that of the container, you'll need to set up special permissions for the target directory if you want to use this Image to clone repositories locally. Once you've configured these permissions, you'll be able to set up a volume and have the contents of the cloned repository replicated on your host machine.

First, create a target directory somewhere in your home folder and set the required permissions:

Expand All @@ -66,23 +67,32 @@ mkdir ~/workspace
chmod go+wrx ~/workspace
```

Now you can use `docker run` to execute the clone command, using the directory you just set up as a volume share between your local machine and the container image on `/home/git`.
Now you can use `docker run` to execute the `git clone` command, using the directory you just set up as a volume shared between your local machine and the container Image:

```shell
docker run -it -v ~/workspace:/home/git --rm cgr.dev/chainguard/git clone https://github.com/chainguard-images/.github.git
```

You should get output like this:
Here, the volume is mounted to the `/home/git` directory in the container.

This will return output like the following:

```
Cloning into '.github'...
remote: Enumerating objects: 217, done.
remote: Counting objects: 100% (104/104), done.
remote: Compressing objects: 100% (74/74), done.
remote: Total 217 (delta 39), reused 78 (delta 27), pack-reused 113
Receiving objects: 100% (217/217), 207.47 KiB | 1.46 MiB/s, done.
Resolving deltas: 100% (70/70), done.
remote: Enumerating objects: 251, done.
remote: Counting objects: 100% (33/33), done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 251 (delta 15), reused 22 (delta 10), pack-reused 218
Receiving objects: 100% (251/251), 216.59 KiB | 1.04 MiB/s, done.
Resolving deltas: 100% (88/88), done.
```

You can now check the contents of your `workspace` directory, where you should find the cloned repo.
You can now check the contents of your `workspace` directory, where you will find the cloned repository:

```shell
ls -a ~/workspace/
```
```
. .. .github
```
<!--body:end-->
7 changes: 6 additions & 1 deletion images/ruby/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<!--monopod:end-->

<!--overview:start-->
Minimal ruby base image.
Minimal Ruby base image.
<!--overview:end-->

<!--getting:start-->
Expand All @@ -26,4 +26,9 @@ docker pull cgr.dev/chainguard/ruby:latest
<!--getting:end-->

<!--body:start-->
## Usage

Ruby applications typically require the installation of third-party dependencies through [Rubygems](https://rubygems.org/). This means that using a fully distroless image for building your application would not work, as these do not include a package manager. In cases like this, you’ll need to implement a multi-stage Docker build that uses one of Chainguard's `-dev` Image variants to set up the application.

We encourage you to check out our guide on [getting started with Ruby](https://edu.chainguard.dev/chainguard/chainguard-images/getting-started/getting-started-ruby/) which demonstrates how you can use Chainguard's Ruby Image in both single- and multi-stage builds.
<!--body:end-->
2 changes: 1 addition & 1 deletion images/ruby/metadata.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ image = "cgr.dev/chainguard/ruby"
logo = "https://storage.googleapis.com/chainguard-academy/logos/ruby.svg"
endoflife = ""
console_summary = ""
short_description = "Minimal ruby base image."
short_description = "Minimal Ruby base image."
compatibility_notes = ""
readme_file = "README.md"
upstream_url = "https://www.ruby-lang.org"

0 comments on commit 563aeca

Please sign in to comment.