Code Monkey home page Code Monkey logo

docker-etcd's Introduction

docker-etcd

Build a etcd server docker image under 30MB. The image contain the etcd and etcdctl binaries.

Version

etcd v2.2.3

docker pull jllopis/etcd:2.2.3

This tiny image starts etcd with the default configuration.

Build

Use the provided Makefile to download the binaries and build the image.

$ make image

The above command clean up the previous files if any, download the binaries from github, unpack it and build the docker image.

You can get help by running

$ make

Check the resulting image with docker:

docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
my_user/etcd        2.2.3               846344ecbfec        4 minutes ago       28.92 MB
jllopis/redis       latest              084ebf298232        26 hours ago        502.4 MB
base                latest              f28c2cabcb3e        30 hours ago        478.3 MB
ubuntu              12.04               9cd978db300e        3 weeks ago         204.4 MB

Start

To start the container execute:

docker run -v local_fs:/data -h {node_host_name} -name {image_name} -p 4001:4001 -p 7001:7001 -p 2379:2379 -p 2380:2380 jllopis/etcd:2.2.3

where:

  • local_fs is the local storage to keep data safe. If not specified it will use the container so the data will be lost upon restart.
  • node_hostname is the name that will hold the HOSTNAME variable inside the container. This is accessible to CMD so etcd will use it as their node name. If not specified a default name will be used.
  • image_name is the name given to the image so you don't have to play with ids

It is also possible to map other ports on the host. Do it adding -p local_port:container_port to docker run:

docker run -d -p 4242:4001 -v local_fs:/data jllopis/etcd:2.2.3

Ports

The ports used are:

  • 2379
  • 2380
  • 4001
  • 7001

Remember that if you want access from outside the container you must explicitly tell docker to do so by setting -p at image launch.

Login

You can not login to the image as it just contain the binaries. Should be no need to do it anyway.

etcdctl

The command is packed with the image. Can run with:

docker run --rm -ti -entrypoint "/etcdctl" jllopis/etcd:2.2.3 -v

docker-etcd's People

Contributors

jllopis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.