Using docker in unusual ways

407,984
0
Published 2024-01-17
Docker is one of those tools that has changed my developer workflow for the better. Most of the time I use docker for deploying application code, but there are other ways I use it as well.

In this video, I take a look at some of the other ways I use docker when developing software.

This video is sponsored by Docker. Check out their new features in Docker desktop!
www.docker.com/products/docker-desktop/

Become a better developer in 4 minutes: bit.ly/45C7a29 👈

Join this channel to get access to perks:
youtube.com/channel/UCWQaM7SpSECp9FELz-cHzuQ/join

Join Discord: discord.com/invite/eMjRTvscyt
Join Twitter: twitter.com/dreamsofcode_io

00:00:00 Intro
00:00:36 As a time machine
00:01:49 Running legacy Code
00:04:12 Hosting a Local Stack
00:07:52 Integration Testing
00:09:55 Improving Application Securit

All Comments (21)
  • I'm a firmware engineer. We use docker for our 'automated test' stations - the devices under test are all connected to a host machine which is running multiple copies of the same docker - one for each set of hardware, with devices passed into the docker (together with the station number). Each instance is a Jenkins slave node, and has labels for the capabilities/configuration of each station. Out automated tests (which number in the 1000s), run on the first available node with the required labels. We can now run our tests overnight rather than the manual testing which took weeks. Doesn't completely eliminate manual testing, but if a release candidate passes all the unit tests, integration tests, and automated tests, it only rarely has an issue beyond something esthetic.
  • @cbg4567
    Mounting the source directory as a volume also works so you don't need to rebuild the image any time code changes.
  • @user-oj9iz4vb4q
    I think the most odd use of docker I've come across was in embedded systems. I worked for a company that manufactured single board computers and they needed to be tested during manufacturing. Normally that means making a specific test image for an SD card, burning it and shipping that out to the manufacturer. Instead, we made a single test image which phones home with the board serial number and it then looks up and pulls down a specific test docker image to run the tests. Now no more burning and the SD cards don't wear out. The manufacturer can then use the same image for all the boards.
  • @rnd-gem
    VSCode Devcontainers are my favourite use-case.
  • @epikPhailure
    This is something I've been researching using docker for. This video has inspired me to go full send.
  • @georgehelyar
    We've just started using test containers at my work, its really nice for testing the integration with the database. In the past we tried to mock the database connections in the unit test and only integration test the whole service, but this lets us easily use a real database for the unit tests of the data access layer, which we have running live as we type. You can type SQL into a string and watch the test go green as you type, with no mocking.
  • @devdetour
    Really really cool to learn about these commands - I've been getting into docker more and more recently and I am SO excited to try docker init for some of my old projects that I want to run in containers!
  • @noahisamathnerd
    I often use Docker containers as an isolated development environment. I’m currently taking a CS class that requires a set of Python modules provided by the textbook, but they don’t install properly in macOS Sonoma and Python 3.12 and haven’t been updated since 3.6 was current. Thankfully, Docker was there to save the day! A bit of scripting to automate the module installation, system updates, and setting my preferred PS1, and it works great. Plus, not having to install development dependencies and SDKs for Python, Java, Rust, Node, and C (gotta try ‘em all!) all on one device is nice. If I’m done with a language, I can just nuke its image and volume!
  • @BroileR2007
    Amazing, the testcontainers package is super useful. As well as this whole video. Thank you!
  • @baz5719
    The quality of these videos is amazing. Awesome job 😎
  • @StephenHoldaway
    One odd use of Docker I've written is publishing versioned images containing only files that another service in a much larger compose file needs (since docker doesn't have any concept of publishing a volume). That image simply copies its assets to a volume mount and exits, making the files accessible to other processes with access to that volume
  • @hacktor_92
    i've used docker for programming languages and tools for a while. so much that i've made myself some aliases to run those images with mounted volumes. but the whole `docker compose run ` brings this to the next level, so i'll probably do some sort of asdf.
  • @AaronPM55
    We deploy our high speed low level cpp software to a lot of different platforms ranging from embedded systems to cloud infrastructure. To ensure our stuff works for all cases we have our CI/CD pipelines spin up containers for all possible OS, architectures, and compilers we could possibly work with. Then it will build and run our test cases in all of those containers to make sure our core libraries will behave for whatever deployment scenario we run into.
  • @felixinit
    Excelente usos de Docker. Debo revisarlo con más calma luego.
  • @MarvinJWendt
    One of the rare moments where I subscribed instantly. Really nice video! Nice editing, nice story telling and great content. Docker could not have chosen a better partner on this video!
  • @Klusio19
    Instant subscription given after seeing few seconds of the video paried with the clear voice explaining the video