[ 
https://issues.apache.org/jira/browse/CALCITE-1364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15959308#comment-15959308
 ] 

ASF GitHub Bot commented on CALCITE-1364:
-----------------------------------------

Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/calcite-avatica/pull/3#discussion_r110215394
  
    --- Diff: site/_docs/docker_images.md ---
    @@ -0,0 +1,151 @@
    +---
    +layout: docs
    +title: Docker Images
    +sidebar_title: Docker Images
    +permalink: /docs/docker.html
    +---
    +
    +<!--
    +{% comment %}
    +Licensed to the Apache Software Foundation (ASF) under one or more
    +contributor license agreements.  See the NOTICE file distributed with
    +this work for additional information regarding copyright ownership.
    +The ASF licenses this file to you under the Apache License, Version 2.0
    +(the "License"); you may not use this file except in compliance with
    +the License.  You may obtain a copy of the License at
    +
    +http://www.apache.org/licenses/LICENSE-2.0
    +
    +Unless required by applicable law or agreed to in writing, software
    +distributed under the License is distributed on an "AS IS" BASIS,
    +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +See the License for the specific language governing permissions and
    +limitations under the License.
    +{% endcomment %}
    +-->
    +
    +## Docker Images for Avatica
    +
    +[Docker](https://en.wikipedia.org/wiki/Docker_(software)) is a popular 
piece of
    +software that enables other software to run "anywhere". In the context of 
Avatica,
    +we can use Docker to enable a run-anywhere Avatica server. These Docker 
containers
    +can be used to easily create a server for the development of custom 
Avatica clients
    +or encapsulating database access for testing software that uses Avatica.
    +
    +### Base "avatica-server" Docker Image
    +
    +Starting with the Avatica 1.10.0 release, Avatica is providing a number of 
Docker
    +containers. Each of these images is based on a "parent" "avatica-server" 
Docker image.
    +
    +This Docker image has no bindings to a specific database (it has not 
database-specific
    +JDBC driver included). It only contains a Java runtime and the Avatica 
Standalone Server
    +jar (which contains all the necessary dependencies of the Avatica server). 
This docker
    +image is not directly useful for end users; it is useful for those who 
want to use Avatica
    +with a database of their choosing.
    +
    +This Docker image will be deployed to the [Apache Dockerhub 
account](https://hub.docker.com/r/apache/) after the release
    +of 1.10.0 and will be updated for future releases of Avatica.
    +
    +### Database-specific Docker Images
    +
    +To make the lives of end-users who want to use a specific database easier, 
some Docker
    +images are provided for some common databases. The current databases 
include:
    +
    +* [HyperSQL](http://hsqldb.org) (2.3.1)
    +* [MySQL](https://www.mysql.com/) (Client 5.1.41, supports MySQL server 
4.1, 5.0, 5.1, 5.5, 5.6, 5.7)
    +* [PostgreSQL](https://www.postgresql.org/) (Client 42.0.0, supports 
PostgreSQL servers >=8.3)
    +
    +These images are not deployed as the licensing on each database driver is 
varied. Please
    +understand and accept the license of each before using in any software 
project.
    +
    +Each of these images include a `build.sh` script which will build the 
docker image using
    +the latest `avatica-server` Docker image. The resulting Docker image will 
be named according
    +to the following format: `avatica-<database>-server`. For example, 
`avatica-hsqldb-server`,
    +`avatica-mysql-server`, and `avatica-postgresql-server`.
    +
    +Additionally, [Docker Compose](https://github.com/docker/compose) 
configuration files for the above
    +databases (sans HyperSQL) are provided which configure the database's 
standard Docker image
    +and then connect Avatica to that Docker container. For example, the 
PostgreSQL docker-compose configuration
    +file will start an instance of PostgreSQL and an instance of the Avatica 
server, each in their own container,
    +exposing an Avatica server configured against a "real" PostgreSQL database.
    +
    +All of the `Dockerfile` and `docker-compose.yml` files are conveniently 
provided in an archive for
    +each release, starting with 1.10.0.
    +
    +```
    +avatica-docker-1.10.0-SNAPSHOT/
    +avatica-docker-1.10.0-SNAPSHOT/hypersql/
    +avatica-docker-1.10.0-SNAPSHOT/mysql/
    +avatica-docker-1.10.0-SNAPSHOT/postgresql/
    +avatica-docker-1.10.0-SNAPSHOT/Dockerfile
    +avatica-docker-1.10.0-SNAPSHOT/hypersql/build.sh
    +avatica-docker-1.10.0-SNAPSHOT/hypersql/Dockerfile
    +avatica-docker-1.10.0-SNAPSHOT/mysql/build.sh
    +avatica-docker-1.10.0-SNAPSHOT/mysql/docker-compose.yml
    +avatica-docker-1.10.0-SNAPSHOT/mysql/Dockerfile
    +avatica-docker-1.10.0-SNAPSHOT/postgresql/build.sh
    +avatica-docker-1.10.0-SNAPSHOT/postgresql/docker-compose.yml
    +avatica-docker-1.10.0-SNAPSHOT/postgresql/Dockerfile
    +```
    +
    +#### Running
    +
    +Each of the provided database-specific Docker images set an `ENTRYPOINT` 
which
    +encapsulate most of the Java command. The following options are available 
to specify:
    +
    +```
    +Usage: <main class> [options]
    +  Options:
    +    -h, -help, --help
    +       Print the help message
    +       Default: false
    +    -p, --port
    +       Port the server should bind
    +       Default: 0
    +    -s, --serialization
    +       Serialization method to use
    +       Default: PROTOBUF
    +       Possible Values: [JSON, PROTOBUF]
    +  * -u, --url
    +       JDBC driver url for the server
    +```
    +
    +For example, to connect to a MySQL server, the following could be used:
    +
    +```
    +$ ./avatica-docker-*/mysql/build.sh
    +$ docker run --rm -it avatica-mysql-server \
    --- End diff --
    
    Fixed


> Bring Docker image for avatica-standalone-server into Apache
> ------------------------------------------------------------
>
>                 Key: CALCITE-1364
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1364
>             Project: Calcite
>          Issue Type: Task
>          Components: avatica
>            Reporter: Josh Elser
>            Assignee: Josh Elser
>             Fix For: avatica-1.10.0
>
>
> I worked on making some Docker images for the standalone Avatica Server with 
> HSQLDB.
> https://hub.docker.com/r/joshelser/avatica-hsqldb/
> These greatly simplify running the Avatica TCK and also provide a portable 
> server that developers can use when testing custom Avatica clients.
> For >=1.9.0, we should an image into Avatica (upstream). There are a couple 
> of open questions on my mind already:
> 1. What are the release-ability concerns (do we provide SNAPSHOT Dockerfiles 
> but not built images as they may be interpreted as "releases")?
> 2. What ASF integrations exist (do we need to ask Infra for things?)
> 3. Are there any maven plugins we should consider for automation? 
> (https://github.com/spotify/docker-maven-plugin)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to