Skip to content

Commit

Permalink
Set the ENTRYPOINT, rather than the CMD. for the Docker build.
Browse files Browse the repository at this point in the history
This allows us to override the tasks passed to Gradle with our own. For
example, if we wanted to avoid cleaning:

    $ docker run --rm -it -v $PWD:/usr/src/app -v $HOME/.gradle:/root/.gradle sdkman-cli/gradle -x clean

As non-test tasks can now be passed to Gradle, I have changed the tag
of the image to something more general.
  • Loading branch information
SamirTalwar committed Mar 5, 2016
1 parent dde4665 commit 8909e17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ RUN mkdir -p /usr/src/app
ADD . /usr/src/app
WORKDIR /usr/src/app

CMD ["./gradlew"]
ENTRYPOINT ["./gradlew"]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ Mac users can add the following line to their `~/.bash_profile` file to set this

You can run the tests in a Docker container to guarantee a clean test environment.

$ docker build --tag=sdkman-cli/testing .
$ docker run --rm -it sdkman-cli/testing
$ docker build --tag=sdkman-cli/gradle .
$ docker run --rm -it sdkman-cli/gradle

By running the following command, you don't need to wait for downloading Gradle wrapper and other dependencies. The test reports can be found under the local `build` directory.

$ docker run --rm -it -v $PWD:/usr/src/app -v $HOME/.gradle:/root/.gradle sdkman-cli/testing
$ docker run --rm -it -v $PWD:/usr/src/app -v $HOME/.gradle:/root/.gradle sdkman-cli/gradle

## Running the Server Locally

Expand Down

0 comments on commit 8909e17

Please sign in to comment.