From d7cb08c66bb854913f15d95c5c6c93184b5ab3f7 Mon Sep 17 00:00:00 2001 From: jarvis Date: Tue, 19 Sep 2023 20:49:27 +0800 Subject: [PATCH] [Feature] add dockerfile --- docs/en/start-v2/docker/docker.md | 41 +++++++++++++++++++++++++++++-- seatunnel-dist/docker/Dockerfile | 15 +++++++++++ 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 seatunnel-dist/docker/Dockerfile diff --git a/docs/en/start-v2/docker/docker.md b/docs/en/start-v2/docker/docker.md index fd927deabbd5..5a78fddca1e3 100644 --- a/docs/en/start-v2/docker/docker.md +++ b/docs/en/start-v2/docker/docker.md @@ -5,5 +5,42 @@ sidebar_position: 3 # Set Up with Docker - ---> +### Download basic image +```shell +docker pull seatunnel-light:version +``` + +### Install the connector your needed +there has multiple ways to install the connector jar. +1. rebuild customized image with the basic image + +```Dockerfile +FROM seatunnel-light:version + +# change the connector name and version +RUN wget https://repo1.maven.org/maven2/org/apache/seatunnel///-.jar -P /opt/seatunnel/connectors/seatunel && \ + wget https://repo1.maven.org/maven2/org/apache/seatunnel///-.jar -P /opt/seatunnel/connectors/seatunel + +... + +``` +2. Mount the lib locally +you can download the lib from maven to local manually, and mount this folder to container. +```shell +docker run -v :/opt/seatunnel/connectors/seatunel \ + ... + seatunnel-basic-image:version +``` + +### Start The job +```shell +## batch process +docker run --rm -it seatunnel-basic-image:version bash ./bin/seatunnel.sh -e local --config config/v2.batch.config.template + +# start streaming process +docker run --rm -it seatunnel-basic-image:version bash ./bin/seatunnel.sh -e local --config config/v2.streaming.conf.template +``` + + + + diff --git a/seatunnel-dist/docker/Dockerfile b/seatunnel-dist/docker/Dockerfile new file mode 100644 index 000000000000..89ae2b8fcfa8 --- /dev/null +++ b/seatunnel-dist/docker/Dockerfile @@ -0,0 +1,15 @@ +FROM openjdk:8 + +RUN apt update ; \ + apt install -y wget ; + +ARG VERSION=2.3.3 + +RUN wget "https://archive.apache.org/dist/seatunnel/$VERSION/apache-seatunnel-$VERSION-bin.tar.gz" -P /opt && \ + cd /opt && \ + tar -zxvf apache-seatunnel-$VERSION-bin.tar.gz && \ + mv apache-seatunnel-$VERSION seatunnel && \ + rm apache-seatunnel-$VERSION-bin.tar.gz && \ + wget "https://repo.maven.apache.org/maven2/org/apache/seatunnel/seatunnel-hadoop3-3.1.4-uber/$VERSION/seatunnel-hadoop3-3.1.4-uber-$VERSION-optional.jar" -P /opt/seatunnel/lib + +WORKDIR /opt/seatunnel