Skip to content

Commit

Permalink
Move Docker image to new repo, use dev-only image
Browse files Browse the repository at this point in the history
In #34, development tools were added to the clitest Docker image, making
it both an end user image and a development environment. This was a bad
idea.

This commit separates them in two different images.

- The public clitest image was moved to a new repository:
  https://github.com/aureliojargas/clitest-docker. Now everything is
  automated and releasing a new clitest image to Docker Hub is just a
  matter of adding a git tag to that repository. Everything related to
  that image was removed from this repository.

- The local development image remains here, named `clitest-dev` and
  described in the new `Dockerfile.dev` file. It does not have clitest
  inside it, it's just the development environment. When running the
  image, the current clitest code should be mounted inside it.

In short, everything dev-related is here. After releasing a new clitest
version (here), go to the other repository to make the official Docker
image for it.
  • Loading branch information
aureliojargas committed Jun 30, 2020
1 parent 2cb00b3 commit 1d58862
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 144 deletions.
14 changes: 0 additions & 14 deletions Dockerfile

This file was deleted.

19 changes: 19 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# clitest-dev
# Local Docker image used for clitest development.
#
# It has all the required tools for linting and testing clitest code.
# See Makefile for commands to build and run this image.
#
# If you're searching for the official clitest Docker image (for users):
# https://hub.docker.com/r/aureliojargas/clitest

FROM alpine:3.11

# Perl is required by clitest's --regex matching mode
RUN apk --no-cache add \
bash dash mksh zsh \
perl \
make \
checkbashisms shellcheck

WORKDIR /mnt
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Developer workflow: run locally the same commands Travis will run in
# the CI. See the .travis.yml file for the list of commands.
#
# By default, the linting and testing targets are run inside the clitest
# Docker container. To run them directly on the host, avoiding the
# container, unset the `docker_run` variable. Examples:
# By default, the linting and testing targets are run inside the
# clitest-dev Docker container. To run them directly on the host,
# avoiding the container, unset the `docker_run` variable. Examples:
#
# make test-bash # test using container's bash
# make test-bash docker_run= # test using host's bash

docker_image = aureliojargas/clitest
docker_run = docker run --rm -it -v $$PWD:/clitest $(docker_image)
test_cmd = clitest --first --progress none test.md
docker_image = clitest-dev
docker_run = docker run --rm -it -v $$PWD:/mnt $(docker_image)
test_cmd = ./clitest --first --progress none test.md

default:
@echo "Read the comments in the Makefile for help"
Expand All @@ -27,7 +27,7 @@ versions:
@$(docker_run) sh -c 'apk list 2>/dev/null | cut -d " " -f 1 | sort'

docker-build:
docker build -t $(docker_image) .
docker build -t $(docker_image) -f Dockerfile.dev .

docker-run:
$(docker_run) $(cmd)
118 changes: 0 additions & 118 deletions README-docker.md

This file was deleted.

17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,19 @@ sudo mv clitest /usr/bin

Now check if everything is fine:

```console
$ clitest -V
clitest HEAD
https://github.com/aureliojargas/clitest/tree/HEAD
$
```
clitest --help
```


## Docker image

You can also run clitest in a Docker container ([more info in Docker Hub](https://hub.docker.com/r/aureliojargas/clitest)).

```
docker run --rm -t aureliojargas/clitest --help
```


## Quick Intro

Expand Down

0 comments on commit 1d58862

Please sign in to comment.