File tree Expand file tree Collapse file tree
docker/slim/public-key-auth Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11How to start a local Docker container with public key based authentication
22
331 . Configure Docker to use secrets in the build process
4-
4+ ```
55echo "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
15172 . Generate a public private key pair
16-
18+ ```
1719mkdir -p ~/.ssh/runhouse/docker
1820ssh-keygen -t rsa -b 4096 -C "[email protected] " -f ~/.ssh/runhouse/docker/id_rsa 21+ ```
1922
20233 . The Dockerfile in the current directory should support public key based authentication using Docker Secrets for its build process
2124
22254 . Build the Docker container
23-
26+ ```
2427docker 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
26305 . Run the Docker container
27-
31+ ```
2832docker 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
30356 . Verify via SSH
31-
36+ ```
3237ssh -i ~/.ssh/runhouse/docker/id_rsa rh-docker-user@localhost
38+ ```
You can’t perform that action at this time.
0 commit comments