1. 5
  1.  

  2. 7

    Is this truly what the world has come to?

    Productivoty gains by writing Dockerfiles, config and shell scripts, when any sane framework and/or standard library gives you the tools to mock things.

    Like why would a local developer want redis?

    Leave the hall.

    1. 3

      The idea is to have a dev environment that closely resembles your production environment.

      1. 3

        I think you should use a virtual machine for this, though. For instance, in the project I’m working on, I’m on Linux and the other two developers are on Macs so my understanding is that Docker won’t help.

        1. 3

          This is exactly where docker helps.

          1. 2

            My understanding is that software packaged by Docker still uses the host operating system’s libraries/etc. under the hood. Is this correct? If so, then it doesn’t seem like a solution as we’d be still running on different operating systems.

            1. 2

              Not at all. You can run a different district. Everything is duplicated and you only have the exact versions specified.

              1. 2

                I’m sorry, I mentioned libraries but this is not what I really had in mind. (I also assume that autocorrect changed “distro” to “district” in your reply). I’m concerned about platform-specific issues like path lengths, characters allowed in file names, kernel APIs, low-level system stuff (e.g. OOM killer).

                If the problem statement is: developers (and production) use different environments then the solution would be to make them use the same environment. I use VMs to achieve that and my impression is that virtualized environments are closer to “identical” than containers.

                1. 3

                  characters allowed in file names

                  Funny you should mention that. I ran into exactly this sort of a problem last week, where Docker, (which uses the host’s FS) couldn’t differentiate between files that differ only by case on MacOS’s case-insensitive-by-default filesystem. As a result, the state of my system running on Docker was significantly different from that on an Ubuntu machine, even with everything else (libraries, etc.) being the exact same.

                  That being said, I still find Docker very useful for quickly spinning up an instance of something on my Mac. But in the future, I’ll think more carefully about where the abstraction ends and the host starts mattering.

                  1. 2

                    #needsmorevagrant

      2. 1

        Simply put: if environments don’t match, mistakes get made.

        I’ve seen it time and time again - to give some examples: local dev using a mocked out in memory cache, prod using memcached/redis; or local dev using SQLite and prod using Postgres. Mistakes get made due to overlooking the differences between implementations.

        No mock is as perfect as the real thing and it’s much nicer finding issues in development than at deploy time.

        1. 2

          Fire the dev and hire someone who knows integration testing.

          1. 1

            local dev using SQLite and prod using Postgres

            I was in a similar situation (but with MySQL instead of Postgres). We were getting failure in production that we couldn’t reproduce in development. It seemed as if the program was trying to insert data into a column of the wrong type. This is how I learnt that SQLite does dynamic typing which is code for “we don’t care about column types”.

            1. 1

              Yep, it’s the same for testing. There are plenty of companies out there use in-memory SQLite databases with their test suite “for speed”, without realising they’re basically throwing type safety out of the window and making their tests effectively useless.

              1. 1

                “Boss, I wrote a program that does the wrong thing but does it really fast!”

          2. 1

            redis is not only a good replacement of memcached, it is a great pub/sub server, a leaderboard and has a geoip api. I need redis in development because I use redis to implement features that use the apis that redis provide.

            On the other side, even if am not a huge fan of docker, docker is useful in many cases. For example I use Void Linux and OpenBSD as my desktop operating systems. In one of our client we store data in riak. riak is not available in Void Linux, neither in OpenBSD. Thanks to docker I can easily run riak in docker.