mirror of
				https://github.com/drwetter/testssl.sh.git
				synced 2025-10-31 13:55:25 +01:00 
			
		
		
		
	docs: Revise Dockerfile.md
				
					
				
			- Use GH alerts for displaying notes - Relative links to `Dockerfile`s - `Dockerfile-alpine` => `Dockerfile.alpine`
This commit is contained in:
		 Brennan Kinney
					Brennan Kinney
				
			
				
					committed by
					
						 polarathene
						polarathene
					
				
			
			
				
	
			
			
			 polarathene
						polarathene
					
				
			
						parent
						
							46896fb8b1
						
					
				
				
					commit
					324ec443db
				
			| @@ -17,11 +17,13 @@ Use a volume bind mount to a local host directory to access the files outside of | |||||||
| docker run --rm -it -v /tmp:/data --workdir /data ghcr.io/testssl/testssl.sh:3.2 --htmlfile ./ example.com | docker run --rm -it -v /tmp:/data --workdir /data ghcr.io/testssl/testssl.sh:3.2 --htmlfile ./ example.com | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| **NOTE:** | > [!NOTE] | ||||||
| - The UID/GID ownership of the file will be created by the container user `testssl` (`1000:1000`), with permissions `644`. | > - The UID/GID ownership of the file will be created by the container user `testssl` (`1000:1000`), with permissions `644`. | ||||||
| - Your host directory must permit the `testssl` container user or group to write to that host volume. You could alternatively use [`docker cp`](https://docs.docker.com/reference/cli/docker/container/cp/). | > - Your host directory must permit the `testssl` container user or group to write to that host volume. You could alternatively use [`docker cp`](https://docs.docker.com/reference/cli/docker/container/cp/). | ||||||
|  |  | ||||||
| ### From DockerHub or GHCR | ## Images | ||||||
|  |  | ||||||
|  | ### Available at DockerHub and GHCR | ||||||
|  |  | ||||||
| You can pull the image from either of these registries: | You can pull the image from either of these registries: | ||||||
| - DockerHub: [`drwetter/testssl.sh`](https://hub.docker.com/r/drwetter/testssl.sh) | - DockerHub: [`drwetter/testssl.sh`](https://hub.docker.com/r/drwetter/testssl.sh) | ||||||
| @@ -31,7 +33,7 @@ Supported tags: | |||||||
| - `3.2` / `latest` | - `3.2` / `latest` | ||||||
| - `3.0` is the old stable version ([soon to become EOL](https://github.com/testssl/testssl.sh/tree/3.0#status)) | - `3.0` is the old stable version ([soon to become EOL](https://github.com/testssl/testssl.sh/tree/3.0#status)) | ||||||
|  |  | ||||||
| ### Building | ### Building the `testssl.sh` container image | ||||||
|  |  | ||||||
| You can build with a standard `git clone` + `docker build`. Tagging the image will make it easier to reference. | You can build with a standard `git clone` + `docker build`. Tagging the image will make it easier to reference. | ||||||
|  |  | ||||||
| @@ -41,26 +43,30 @@ git clone --branch 3.2 --depth 1 https://github.com/testssl/testssl.sh . | |||||||
| docker build --tag localhost/testssl.sh:3.2 . | docker build --tag localhost/testssl.sh:3.2 . | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| There are two base images available: | There are two base images supported: | ||||||
| - `Dockerfile` (openSUSE Leap), glibc-based + faster. | - openSUSE Leap ([`Dockerfile`](./Dockerfile)), glibc-based + faster. | ||||||
| - `Dockerfile-alpine` (Alpine), musl-based + half the size. | - Alpine ([`Dockerfile`](./Dockerfile.alpine)), musl-based + half the size. | ||||||
|  |  | ||||||
| Alpine is made available if you need broarder platform support or an image about 30MB smaller at the expense of speed. | The Alpine variant is made available if you need broarder platform support, or an image about 30MB smaller at the expense of slightly slower performance. | ||||||
|  |  | ||||||
|  | #### Tip - Remote build context + `Dockerfile` | ||||||
|  |  | ||||||
| #### Remote build context + `Dockerfile` |  | ||||||
| You can build with a single command instead via: | You can build with a single command instead via: | ||||||
|  |  | ||||||
| ```bash | ```bash | ||||||
| docker build --tag localhost/testssl.sh:3.2 https://github.com/testssl/testssl.sh.git#3.2 | docker build --tag localhost/testssl.sh:3.2 https://github.com/testssl/testssl.sh.git#3.2 | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| This will produce a slightly larger image however as `.dockerignore` is not supported with remote build contexts. | > [!NOTE] | ||||||
|  | > This will produce a slightly larger image as [`.dockerignore` is not supported with remote build contexts](https://github.com/docker/buildx/issues/3169). | ||||||
|  |  | ||||||
| If you would like to build the Alpine image instead this way, just provide the alternative `Dockerfile` via `--file`: | --- | ||||||
|  |  | ||||||
|  | To build the Alpine image instead, additionally provide the ([alternative `Dockerfile`](./Dockerfile.alpine)) via the `--file` option: | ||||||
|  |  | ||||||
| ```bash | ```bash | ||||||
| docker build \ | docker build \ | ||||||
|   --tag localhost/testssl.sh:3.2-alpine \ |   --tag localhost/testssl.sh:3.2-alpine \ | ||||||
|   --file https://raw.githubusercontent.com/testssl/testssl.sh/3.2/Dockerfile-alpine \ |   --file https://raw.githubusercontent.com/testssl/testssl.sh/3.2/Dockerfile.alpine \ | ||||||
|   https://github.com/testssl/testssl.sh.git#3.2 |   https://github.com/testssl/testssl.sh.git#3.2 | ||||||
| ``` | ``` | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user