Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM alpine:latest AS base

# Notes
# 1. `ca-certificates` is so we can use TLS (i.e., so dbc search works)
# 2. Creating /tmp is so we can install drivers (dbc uses /tmp)
RUN apk --update add ca-certificates && \
mkdir -p /tmp && \
chmod 1777 /tmp

FROM scratch
COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=base /tmp /tmp
ENTRYPOINT ["/dbc"]
COPY dbc /
36 changes: 35 additions & 1 deletion resources/README.dockerhub.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,44 @@ limitations under the License.
[dbc](https://columnar.tech/dbc) is a command-line tool for installing and managing [ADBC](https://arrow.apache.org/adbc) drivers.
This is the official set of Docker images for dbc.

Note: These images are intended to be an easy way to run dbc and aren't designed for running typical analytical workloads inside the container. We recommend building your own images for more complicated use cases.

## Usage

To run dbc and have it print its usage:

```sh
docker run -it --rm columnar/dbc:latest --help
```

To search for drivers,

```sh
docker run -it --rm columnar/dbc:latest search
```

To install a driver, a few extra flags must be set. The reason for this is that dbc's docker images are based on the scratch image which has no filesystem.

Instead of attempting to install a driver into the container (which will fail), we mount a folder from our host (`$(pwd)/drivers`) into the container and specify that dbc should use that by setting the `ADBC_DRIVER_PATH` environment variable:

```sh
docker run --rm \
-v $(pwd)/drivers:/drivers \
-e ADBC_DRIVER_PATH=/drivers \
dbc:latest install sqlite
```

You should now see the sqlite driver installed _outside_ of the container,

```sh
docker run -it --rm columnar/dbc:latest dbc --help
$ tree drivers
drivers
├── sqlite_linux_arm64_v1.10.0
│   ├── libadbc_driver_sqlite.so
│   ├── libadbc_driver_sqlite.so.sig
│   ├── LICENSE.txt
│   └── NOTICE.txt
└── sqlite.toml
```

## Image tags
Expand Down