Skip to content

Commit 960c92b

Browse files
Merge pull request #5 from commitd/je-docker
Add Docker CLI
2 parents ef00084 + c966d53 commit 960c92b

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
66
ENV MAVEN_VERSION 3.3.9
77
ENV NODE_VERSION 10
88
ENV HELM_VERSION 2.9.1
9+
ENV DOCKER_VERSION=19.03.7
910
ENV CLOUD_SDK_REPO cloud-sdk-cosmic
1011
ENV PATH /opt/conda/bin:$PATH
1112

@@ -75,5 +76,10 @@ RUN wget --quiet https://repo.anaconda.com/archive/Anaconda3-5.3.0-Linux-x86_64.
7576
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
7677
echo "conda activate base" >> ~/.bashrc
7778

79+
# Docker-cli
80+
RUN wget --quiet https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz && \
81+
tar -xzvf docker-${DOCKER_VERSION}.tgz --strip 1 -C /usr/local/bin docker/docker && \
82+
rm docker-${DOCKER_VERSION}.tgz
83+
7884
RUN apt-get clean && \
7985
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ The build tools included are:
3030
- **Ansible** 2.8.5
3131
- **Chrome** 80.0.3962.2 dev
3232
- **Anaconda3** 5.3.0
33+
- **Docker CLI** 19.03.7
3334

3435
## Use
3536

@@ -42,6 +43,25 @@ The simplest use in a drone pipeline is shown below, you just have to provide th
4243
- build.sh
4344
```
4445
46+
To use docker, connect to the Docker daemon on the host machine by mounting the Docker socket as a volume:
47+
48+
```yaml
49+
- name: build
50+
image: committed/ci
51+
commands:
52+
- docker ps
53+
volumes:
54+
- name: docker_sock
55+
path: /var/run/docker.sock
56+
57+
...
58+
59+
volumes:
60+
- name: docker_sock
61+
host:
62+
path: /var/run/docker.sock
63+
```
64+
4565
## Development
4666
4767
To build the docker image run:

test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ docker run --rm committed/ci ansible --version
1010
docker run --rm committed/ci google-chrome --version
1111
docker run --rm committed/ci conda --version
1212
docker run --rm committed/ci python -V
13+
docker run --rm committed/ci docker --version

0 commit comments

Comments
 (0)