Files
containers/slides/secure-containers/sampleapp.md
Marco Verleun b6e70b4cac
Some checks failed
Gitea Actions Demo Training / Explore-Gitea-Actions (push) Failing after 14s
Fixed files
2024-01-07 21:17:15 +01:00

1.4 KiB

Which application needs to be secured

  • It is a DockerCoin miner! 💰🐳📦🚢

--

  • No, you can't buy coffee with DockerCoin

--

  • How dockercoins works:

    • generate a few random bytes

    • hash these bytes

    • increment a counter (to keep track of speed)

    • repeat forever!

--

  • DockerCoin is not a cryptocurrency

    (the only common points are "randomness," "hashing," and "coins" in the name)


DockerCoin in the microservices era

  • The dockercoins app is made of 5 services:

    • rng = web service generating random bytes

    • hasher = web service computing hash of POSTed data

    • worker = background process calling rng and hasher

    • webui = web interface to watch progress

    • redis = data store (holds a counter updated by worker)

  • These 5 services are visible in the application's Compose file, docker-compose.yml


How dockercoins works

  • worker invokes web service rng to generate random bytes

  • worker invokes web service hasher to hash these bytes

  • worker does this in an infinite loop

  • every second, worker updates redis to indicate how many loops were done

  • webui queries redis, and computes and exposes "hashing speed" in our browser

(See diagram on next slide!)


class: pic

Diagram showing the 5 containers of the applications