Docker at Tradeshift

Bo Gotthardt

mail@gotthardt.bo

Tradeshift

  • Network for invoices and business communication
  • "App" platform
  • Split into individual server "components"
  • Java/Scala/Grails

Why Docker?

  • Busy Operations team
  • Existing components are complex
  • New Node.js component
  • Want to move to microservice components

Setup

  • Reuse exact same images for test and deploy
  • Build images with quay.io
  • Code from two repositories?

Server code

GitHub

quay.io

Build

server

Apps

code

Docker

container

Server code

GitHub

quay.io

Build

server

Apps

code

Docker

container

quay.io

Production!

Still in progress

  • Dockerize existing components
  • Tradeshift-specific base images
  • Two images for each component
    • Backend server
    • Server for apps
  • Orchestration

Gotchas

  • All the Maven plugins suck
  • Groovy scripts to replace Maven plugins suck
  • Configuration is hard
  • A big system can't be Dockerized in one go
  • Orchestration tool with third-party repo?
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>docker-build</id>
            <phase>deploy</phase>
            <goals><goal>exec</goal></goals>
            <configuration>
                <executable>docker</executable>
                <arguments>
                    <argument>build</argument>
                    <argument>-t</argument>
                    <argument>${docker.imageName}:${git.branch}</argument>
                    <argument>${project.build.directory}</argument>
                </arguments>
            </configuration>
        </execution>
        <execution>
            <id>docker-login</id>
            <phase>deploy</phase>
            <goals><goal>exec</goal></goals>
            <configuration>
                <executable>docker</executable>
                <arguments>
                    <argument>login</argument>
                    <argument>-u</argument>
                    <argument>${docker.username}</argument>
                    <argument>-p</argument>
                    <argument>${docker.password}</argument>
                    <argument>-e</argument>
                    <argument>${docker.email}</argument>
                    <argument>${docker.host}</argument>
                </arguments>
$ docker run -d quay.io/tradeshift/cloudscan-conversion:3bf4dcd
536d0d7c502387adf55298aef79c66f14f98942b29d847884e400fb725401e45
$ docker logs 536d0d7c502387adf55298aef79c66f14f98942b29d847884e400fb725401e45

2014/11/26 15:43:42 Error response from daemon: 404 Page not found

Integration tests run...

Questions?

Docker at Tradeshift

By Bo Gotthardt

Docker at Tradeshift

  • 688