# Docker

## Docker with Spring Boot

### Debug application

```
version: '3.2'
gateway:
    build: gateway
    ports:
    - target: 5004
      published: 5004
      protocol: tcp
      mode: host
    command: "java -Xmx200m -jar '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5004' /app/gateway.jar"
```

restart docker container&#x20;

`docker-compose up -d --no-deps --build [service]`

## [Why not use Alpine Linux](https://martinheinz.dev/blog/92)

`musl` is an implementation of C standard library, lightweight and simpler than `glibc` (Used in Ubuntu). They are mostly interchangeable.

**Edgecase is**: `musl` does not support [DNS-over-TCP](https://serverfault.com/questions/404840/when-do-dns-queries-use-tcp-instead-of-udp/404843#404843). Usually single UDP packet (512 bytes) is enough to resolve hostname, until it is not enough and you get random "Unknown host" errors. [MORE DETAILS](https://purplecarrot.co.uk/post/2021-09-04-does_alpine-resolve_dns_properly/).

