Skip to content

Rust json api Containerization with WSL, Custom Root Certificate, Containerd and Kaniko

License

Notifications You must be signed in to change notification settings

giuliohome/rust-rocket-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Containerization

Use a Dockerfile from rocket guide, but modified to include a custom root certificate (uncomment and copy it here!) and a json folder as well as a static folder.

wsl
  • Pull Kaniko image into ctr (start containerd first)
sudo ctr i pull gcr.io/kaniko-project/executor:latest
  • build with Kaniko and export to a local tar
sudo ctr run --net-host --rm --mount type=bind,src=$(pwd),dst=/workspace,options=rbind:rw gcr.io/kaniko-project/executor:latest kaniko-executor /kaniko/executor --dockerfile=/workspace/Dockerfile --context=/workspace --no-push --skip-tls-verify --build-arg pkg=hello-rocket --tarPath=/workspace/rust-playground-kaniko.tar --destination=localhost/rust-playground-kaniko:latest
  • Import the image into containerd
sudo ctr image import rust-playground-kaniko.tar
  • Create the container
sudo ctr c create --net-host localhost/rust-playground-kaniko:latest rust-playground
  • Start the task
sudo ctr t start rust-playground
sudo ctr t kill -s 9 rust-playground
  • Tag the image
sudo ctr image tag localhost/rust-playground-kaniko:latest docker.io/${DHUSER}/rust-playground-kaniko:latest
  • Push the image
sudo ctr images push \
    --user "${DHUSER}:${DHTOKEN}" \
    docker.io/${DHUSER}/rust-playground-kaniko:latest
cd k8s
kubectl apply -f deployment.yml
kubectl rollout status deployment/rust-web -n rust

DigitalOcean Referral Badge

About

Rust json api Containerization with WSL, Custom Root Certificate, Containerd and Kaniko

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published