Using docker in unusual ways

preview_player
Показать описание
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!

Join this channel to get access to perks:

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 Security
Рекомендации по теме
Комментарии
Автор

have never seen someone be sponsored by docker damn

yugalkhanal
Автор

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.

slartibartfasttynsol
Автор

Mounting the source directory as a volume also works so you don't need to rebuild the image any time code changes.

cbg
Автор

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.

ojizvbq
Автор

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.

georgehelyar
Автор

VSCode Devcontainers are my favourite use-case.

rnd-gem
Автор

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

StephenHoldaway
Автор

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!

noahisamathnerd
Автор

I don't see how many of these are odd. I've been doing a lot of them since I learned how to use Docker.

The "watch" feature is super nice though. You no longer have to rely on the various watch features of the different build tools.

disguysn
Автор

One cool use case is ripping blu-ray's contents using Docker. You can have it automated by simply inserting a blu-ray disc into a drive on the machine the docker container is running on

guitaripod
Автор

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.

AaronPM
Автор

This is something I've been researching using docker for. This video has inspired me to go full send.

epikPhailure
Автор

I personally use containers as my main Work machine. Meaning i have my dev tools in it and just mount a volume that is my home drive.
The reason is the same as you mentioned in your video, reliability and reproducability. I dont have to wonder if an update screws over my work envirnonment.

Also it can run everywhere so all i have to do is to make sure i have ssh and the image on any of my hosts.

badrequest
Автор

The test cointainer is pretty amazing, this is something that I would never expect from the Docker.

ShinSpiegel
Автор

Great video!
My oddest docker use case is, we have an application which works API first, and as part of that workflow we want to generate libraries for the various services and clients to match the API specification.
One of those applications is a flutter mobile application. What was challenging was to ensure we had method of building the flutter library on any machine or pipeline.
Our solution was that we have a docker file create an environment where we can build the dart code and then we copy the volume/output from the container back into the project so it can be versioned.

sidude
Автор

Been using docker in my day to day since it's early days and TIL it can run GUI apps 🤯 😊

jonniem
Автор

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 <service-name>` brings this to the next level, so i'll probably do some sort of asdf.

hacktor_
Автор

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!

MarvinJWendt
Автор

the last 3 ways are fairly standard usages of Docker in any IT company with more than 5 employees (that actually write tests, for that specific use case). But the details are still pretty interesting nonetheless

Comalv
Автор

I discovered testcontainers after watching this video. Would love to see more of how you use are using it! I really like working with devcontainers and this seems like a natural companion. What are your thoughts?

ThijsFranck