You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tz...@apache.org on 2020/03/28 15:41:59 UTC

[flink-statefun] 07/13: [FLINK-16838] [docker] Build image with version tag

This is an automated email from the ASF dual-hosted git repository.

tzulitai pushed a commit to branch release-2.0
in repository https://gitbox.apache.org/repos/asf/flink-statefun.git

commit 541f9572a176d3a9ef0621436ef27271d0360201
Author: Tzu-Li (Gordon) Tai <tz...@apache.org>
AuthorDate: Sat Mar 28 14:00:50 2020 +0800

    [FLINK-16838] [docker] Build image with version tag
    
    We also change the image name from statefun to flink-statefun, to have a
    more consistent naming with other distributions like the Python SDK.
---
 tools/docker/README.md                   | 22 ++++++++++++++++++++++
 tools/docker/build-stateful-functions.sh |  4 +++-
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/tools/docker/README.md b/tools/docker/README.md
new file mode 100644
index 0000000..0b8cc43
--- /dev/null
+++ b/tools/docker/README.md
@@ -0,0 +1,22 @@
+# Stateful Functions Docker Image
+
+This directory contains scripts to build images using the current source version.
+
+The scripts here assumes that distribution and core artifacts are already built from the current source, and adds them to the image build context.
+Therefore, before executing the scripts, make sure to build the project first using `mvn clean package -DskipTests`.
+
+## Building the image
+
+```
+./build-stateful-functions.sh
+```
+
+This builds the `flink-statefun` image, tagged with the current source version.
+
+## Code examples and E2E tests
+
+There are several [examples](../../statefun-examples) and [end-to-end tests](../../statefun-e2e-tests) that rely
+on images built with the corresponding source version.
+
+For released versions, the required image should be available in the Docker Hub registry.
+For snapshots / unstable versions, you would need to build the image locally with the scripts here.
diff --git a/tools/docker/build-stateful-functions.sh b/tools/docker/build-stateful-functions.sh
index 0c950dc..eef29d6 100755
--- a/tools/docker/build-stateful-functions.sh
+++ b/tools/docker/build-stateful-functions.sh
@@ -17,6 +17,8 @@
 
 set -e
 
+VERSION_TAG=2.0-SNAPSHOT
+
 #
 # setup the environment 
 #
@@ -56,7 +58,7 @@ cp ${core_jar} ${docker_context_flink}/lib/statefun-flink-core.jar
 cd ${docker_context_root}
 cp ${basedir}/Dockerfile ${docker_context_root}
 cp ${basedir}/docker-entry-point.sh ${docker_context_root}
-docker build . -t statefun
+docker build . -t flink-statefun:${VERSION_TAG}
 
 # clean again
 rm -rf ${docker_context_root}