Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #88 Docker Cloud dind image is not building #183

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions docker/images/dev-cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ RUN set -ex \
hkp://p80.pool.sks-keyservers.net:80 \
keyserver.ubuntu.com \
hkp://keyserver.ubuntu.com:80 ;do\
gpg --keyserver "$server" --recv-keys 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D;done \
gpg --no-tty --keyserver "$server" --recv-keys 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D;done \
&& gpg --batch --verify python.tar.xz.asc python.tar.xz \
&& rm -rf "$GNUPGHOME" python.tar.xz.asc \
&& mkdir -p /usr/src/python \
Expand Down Expand Up @@ -111,7 +111,7 @@ RUN set -ex \
hkp://p80.pool.sks-keyservers.net:80 \
keyserver.ubuntu.com \
hkp://keyserver.ubuntu.com:80 ;do\
gpg --keyserver "$server" --recv-keys 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D;done \
gpg --no-tty --keyserver "$server" --recv-keys 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D;done \
&& gpg --batch --verify python.tar.xz.asc python.tar.xz \
&& rm -rf "$GNUPGHOME" python.tar.xz.asc \
&& mkdir -p /usr/src/python \
Expand Down Expand Up @@ -157,7 +157,7 @@ RUN set -ex \
hkp://p80.pool.sks-keyservers.net:80 \
keyserver.ubuntu.com \
hkp://keyserver.ubuntu.com:80 ;do\
gpg --keyserver "$server" --recv-keys 97FC712E4C024BBEA48A61ED3A5CA953F73C700D;done \
gpg --no-tty --keyserver "$server" --recv-keys 97FC712E4C024BBEA48A61ED3A5CA953F73C700D;done \
&& gpg --batch --verify python.tar.xz.asc python.tar.xz \
&& rm -rf "$GNUPGHOME" python.tar.xz.asc \
&& mkdir -p /usr/src/python \
Expand Down
29 changes: 15 additions & 14 deletions docker/images/dev-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## Simple Tags

- [`develop` (*docker/images/dev/Dockerfile*)](https://github.com/simelo/pyskycoin/blob/develop/docker/images/dev/Dockerfile)
- [`dind` (*docker/images/dev/Dockerfile*)](https://github.com/simelo/pyskycoin/blob/develop/docker/images/dev/Dockerfile)
- [`develop` (*docker/images/dev/Dockerfile*)](https://github.com/simelo/pyskycoin/blob/develop/docker/images/dev/Dockerfile)
- [`dind` (*docker/images/dev/Dockerfile*)](https://github.com/simelo/pyskycoin/blob/develop/docker/images/dev/Dockerfile)

# Pyskycoin CLI/DIND development image
## Pyskycoin CLI/DIND development image

This image (CLI) has the necessary tools to build, test, edit, lint and version the Pyskycoin
source code. It comes with some versions of Python (2.7, 3.4, 3.5 and 3.6) and with Vim editor installed, along with some plugins
Expand All @@ -14,9 +14,9 @@ to ease go development and version control with git.
Besides it is possible to use Docker in Docker (DIND) Pyskycoin development image,
it is based on `skycoin/skycoindev-cli:dind` and provides all tools included in Pyskycoin CLI image.

# How to use this image
## How to use this image

## Initialize your development environment.
### Initialize your development environment.

```sh
$ mkdir src
Expand All @@ -30,36 +30,38 @@ This downloads the pyskycoin source to src/pyskycoin and changes the owner
to your user. This is necessary, because all processes inside the container run
as root and the files created by it are therefore owned by root.

## Running commands inside the container
### Running commands inside the container

You can run commands by just passing them to the image. Everything is run
in a container and deleted when finished.

### Running tests
#### Running tests

```sh
$ docker run --rm \
-v ${PWD}/src:/usr/local/src skycoin/skycoindev-python:develop \
sh -c "cd pyskycoin; make test"
```

### Editing code
#### Editing code

```sh
$ docker run --rm \
-v ${PWD}/src:/usr/local/src skycoin/skycoindev-python:develop \
vim
```

## How to use Docker in Docker image
### How to use Docker in Docker image

### Start a daemon instance
#### Start a daemon instance

```sh
$ docker run --privileged --name some-name -d skycoin/skycoindev-python:dind
$ docker run --privileged \
--name some-name \
-d skycoin/skycoindev-python:dind
```

### Where to store data
#### Where to store data

Create a data directory on the host system (outside the container) and mount this to a directory visible from inside the container.

Expand All @@ -74,7 +76,7 @@ $ docker run --privileged --name some-name \
-d skycoin/skycoindev-python:dind
```

# Build your own images
## Build your own images

The build process relies on the following parameters

Expand Down Expand Up @@ -116,4 +118,3 @@ and `master` branch on every push made after merging. The same process
is triggered for all feature branches matching the pattern
`/^([^_]+)_t([0-9]+)_.*docker.*/`. The tag generated for such images
will be of the form `feature-{\1}-{\2}`.

4 changes: 1 addition & 3 deletions docker/images/dev-cli/hooks/build
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

echo "Build hook running"

pwd

# Build :develop tag
docker build --build-arg BDATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg SCOMMIT=$SOURCE_COMMIT \
Expand All @@ -25,7 +23,7 @@ docker build --build-arg BDATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
-t "$IMAGE_NAME" .

# Build :dind tag
if [ "$CACHE_TAG" -eq "develop" ]; then
if [ "$CACHE_TAG" == "develop" ]; then
docker build --build-arg IMAGE_FROM="skycoin/skycoindev-cli:dind" \
--build-arg BDATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg SCOMMIT=$SOURCE_COMMIT \
Expand Down
2 changes: 1 addition & 1 deletion docker/images/dev-cli/hooks/push
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

docker push $IMAGE_NAME

if [ "$CACHE_TAG" -eq "develop" ]; then
if [ "$CACHE_TAG" == "develop" ]; then
docker push $DOCKER_REPO:dind
fi