sslobodr | d046be8 | 2019-01-16 10:02:22 -0500 | [diff] [blame] | 1 | FROM alpine:latest |
| 2 | |
| 3 | ADD etcd /usr/local/bin/ |
| 4 | ADD etcdctl /usr/local/bin/ |
| 5 | RUN mkdir -p /var/etcd/ |
| 6 | RUN mkdir -p /var/lib/etcd/ |
| 7 | |
| 8 | # Alpine Linux doesn't use pam, which means that there is no /etc/nsswitch.conf, |
| 9 | # but Golang relies on /etc/nsswitch.conf to check the order of DNS resolving |
| 10 | # (see https://github.com/golang/go/commit/9dee7771f561cf6aee081c0af6658cc81fac3918) |
| 11 | # To fix this we just create /etc/nsswitch.conf and add the following line: |
| 12 | RUN echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf |
| 13 | |
| 14 | EXPOSE 2379 2380 |
| 15 | |
| 16 | # Define default command. |
| 17 | CMD ["/usr/local/bin/etcd"] |