Skip to content

Commit c0dc309

Browse files
Fix markdown formatting for docker instructions (#1616)
Signed-off-by: zhanluxianshen <[email protected]>
1 parent 0de334e commit c0dc309

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,38 @@
11
How to start a local Docker container with public key based authentication
22

33
1. Configure Docker to use secrets in the build process
4-
4+
```
55
echo "DOCKER_BUILDKIT=1" >> ~/.docker/config.json
6+
```
67

7-
or edit the file manually to make sure it includes
8-
8+
or edit the file manually to make sure it includes
9+
```
910
{
1011
"features": {
1112
"buildkit": true
1213
}
1314
}
15+
```
1416

1517
2. Generate a public private key pair
16-
18+
```
1719
mkdir -p ~/.ssh/runhouse/docker
1820
ssh-keygen -t rsa -b 4096 -C "[email protected]" -f ~/.ssh/runhouse/docker/id_rsa
21+
```
1922

2023
3. The Dockerfile in the current directory should support public key based authentication using Docker Secrets for its build process
2124

2225
4. Build the Docker container
23-
26+
```
2427
docker build --no-cache --pull --rm -f "docker/slim/public-key-auth/Dockerfile" --secret id=ssh_key,src=$HOME/.ssh/runhouse/docker/id_rsa.pub -t runhouse:start .
28+
```
2529

2630
5. Run the Docker container
27-
31+
```
2832
docker run --rm --shm-size=4gb -it -p 32300:32300 -p 6379:6379 -p 52365:52365 -p 22:22 -p 443:443 -p 80:80 runhouse:start
33+
```
2934

3035
6. Verify via SSH
31-
36+
```
3237
ssh -i ~/.ssh/runhouse/docker/id_rsa rh-docker-user@localhost
38+
```

0 commit comments

Comments
 (0)