Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ FROM alpine:edge
ENV DOCKER_MACHINE_NAME=default
ENV DOCKER_MACHINE_PORT=2376

RUN apk -q update && apk add bash docker curl openssh-client py2-pip
RUN apk add --no-cache bash docker curl openssh-client py2-pip

RUN pip install docker-compose
RUN docker-compose --version
RUN pip install docker-compose \
&& docker-compose --version

RUN curl -L https://github.com/docker/machine/releases/download/v0.8.2/docker-machine-`uname -s`-`uname -m` > /usr/bin/docker-machine && chmod +x /usr/bin/docker-machine
RUN docker-machine --version
RUN DOWNLOAD_URL=$(curl -s https://api.github.com/repos/docker/machine/releases | grep browser_download_url | cut -d '"' -f 4 | grep -m 1 docker-machine-`uname -s`-`uname -m`) \
&& curl -L $DOWNLOAD_URL > /usr/bin/docker-machine \
&& chmod +x /usr/bin/docker-machine \
&& docker-machine --version

RUN pip install awscli
RUN pip install awscli \
&& aws --version

COPY entrypoint.sh /

Expand Down
34 changes: 22 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
usage:

docker run --rm \
-e DOCKER_MACHINE_NAME=<machine name (default: default)> \
-e DOCKER_MACHINE_URL=<ip address of target machine> \
-e DOCKER_MACHINE_PORT=<target machine docker port (default: 2376)> \
-e DOCKER_MACHINE_CA_CERT=<contents of ca.pem> \
-e DOCKER_MACHINE_CA_CERT_KEY=<contents of ca-key.pem> \
-e DOCKER_MACHINE_CERT=<contents of cert.pem> \
-e DOCKER_MACHINE_CERT_KEY=<contents of key-pem> \
raketenbasis/docker-machine \
docker run -d --name nginx -p 80:80 nginx:latest
# Usage

```
docker run --rm -it \
-e DOCKER_MACHINE_NAME=<machine name (default: default)> \
-e DOCKER_MACHINE_URL=<ip address of target machine> \
-e DOCKER_MACHINE_PORT=<target machine docker port (default: 2376)> \
-e DOCKER_MACHINE_CA_CERT="$(cat ca.pem )" \
-e DOCKER_MACHINE_CA_CERT_KEY="$(cat ca-key.pem )" \
-e DOCKER_MACHINE_CERT="$(cat cert.pem )" \
-e DOCKER_MACHINE_CERT_KEY="$(cat key.pem )" \
raketenbasis/docker-machine bash
```

## About certificates

Docker Machine use the same certificates for all created machines, so if you want to share them (e.g. in CI) for connecting to machine created by you, create machine with option `--storage-path` with path specific for this specific machine, so it will create certificates only for this machine.

Example:
```
docker-machine --storage-path ~/.docker/machine/machines/citest/ create --driver digitalocean citest
```