Deploy Presto with Docker¶
This guide explains how to install and get started with Presto using Docker.
Note
These steps were developed and tested on Mac OS X, on both Intel and Apple Silicon chips.
Prepare the container environment¶
If Docker is already installed, skip to step 4 to verify the setup. Otherwise, follow the instructions below to install Docker and Colima using Homebrew or choose an alternative method.
Install Homebrew if it is not already present on the system.
Install the Docker command line and Colima tools via the following command:
brew install docker colimaRun the following command to start Colima with defaults:
colima startNote
The default VM created by Colima uses 2 CPUs, 2GiB memory and 100GiB storage. To customize the VM resources, see the Colima README for Customizing the VM.
Verify the local setup by running the following command:
docker run hello-worldThe following output confirms a successful installation.
Hello from Docker! This message shows that your installation appears to be working correctly.
Installing and Running the Presto Docker container¶
Download the latest non-edge Presto container from Presto on DockerHub:
docker pull prestodb/presto:latestDownloading the container may take a few minutes. When the download completes, go on to the next step.
On the local system, create a file named
config.propertiescontaining the following text:coordinator=true node-scheduler.include-coordinator=true http-server.http.port=8080 discovery-server.enabled=true discovery.uri=http://localhost:8080On the local system, create a file named
jvm.configcontaining the following text:-server -Xmx2G -XX:+UseG1GC -XX:G1HeapRegionSize=32M -XX:+UseGCOverheadLimit -XX:+ExplicitGCInvokesConcurrent -XX:+HeapDumpOnOutOfMemoryError -XX:+ExitOnOutOfMemoryError -Djdk.attach.allowAttachSelf=trueTo start the Presto server in the Docker container, run the command:
docker run -p 8080:8080 -it -v ./config.properties:/opt/presto-server/etc/config.properties -v ./jvm.config:/opt/presto-server/etc/jvm.config --name presto prestodb/presto:latestThis command assigns the name
prestofor the newly-created container that uses the downloaded imageprestodb/presto:latest.The Presto server logs startup information in the terminal window. The following output confirms the Presto server is running in the Docker container.
======== SERVER STARTED ========
Removing the Presto Docker container¶
To stop and remove the Presto Docker container, run the following commands:
docker stop presto
docker rm presto
These commands return the name of the container presto when they succeed.