(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{100:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return r})),n.d(t,"metadata",(function(){return l})),n.d(t,"toc",(function(){return c})),n.d(t,"default",(function(){return p}));var a=n(3),i=n(8),o=(n(0),n(129)),r={title:"Build Docker Images",sidebar_label:"build-docker",description:"Build Docker Images"},l={unversionedId:"misc/build-docker",id:"misc/build-docker",isDocsHomePage:!1,title:"Build Docker Images",description:"Build Docker Images",source:"@site/docs/misc/build-docker.md",sourceDirName:"misc",slug:"/misc/build-docker",permalink:"/docs/misc/build-docker",editUrl:"https://github.com/apache/incubator-pinot/edit/master/website/docs/misc/build-docker.md",version:"current",sidebar_label:"build-docker",frontMatter:{title:"Build Docker Images",sidebar_label:"build-docker",description:"Build Docker Images"}},c=[{value:"Pinot",id:"pinot",children:[{value:"How to build a docker image",id:"how-to-build-a-docker-image",children:[]}]},{value:"How to publish a docker image",id:"how-to-publish-a-docker-image",children:[]},{value:"Kubernetes Examples",id:"kubernetes-examples",children:[]},{value:"Pinot Presto",id:"pinot-presto",children:[{value:"How to build",id:"how-to-build",children:[]},{value:"How to push",id:"how-to-push",children:[]},{value:"Configuration",id:"configuration",children:[]},{value:"Volumes",id:"volumes",children:[]},{value:"Kubernetes Examples",id:"kubernetes-examples-1",children:[]}]},{value:"Pinot Superset",id:"pinot-superset",children:[{value:"How to build",id:"how-to-build-1",children:[]},{value:"Configuration",id:"configuration-1",children:[]},{value:"Volumes",id:"volumes-1",children:[]},{value:"Kubernetes Examples",id:"kubernetes-examples-2",children:[]}]}],b={toc:c};function p(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(o.b)("wrapper",Object(a.a)({},b,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)("p",null,"The scripts to build Pinot related docker images is located at ",Object(o.b)("a",{parentName:"p",href:"https://github.com/apache/incubator-pinot/tree/master/docker/images"},"here")),Object(o.b)("p",null,"You can access those scripts by running below command to checkout Pinot repo:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-bash"},"git clone git@github.com:apache/incubator-pinot.git pinot\ncd pinot/docker/images\n")),Object(o.b)("p",null,"You can find current supported 3 images in this directory:"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"Pinot: Pinot all-in-one distribution image"),Object(o.b)("li",{parentName:"ul"},"Pinot-Presto: Presto image with Presto-Pinot Connector built-in."),Object(o.b)("li",{parentName:"ul"},"Pinot-Superset: Superset image with Pinot connector built-in.")),Object(o.b)("h2",{id:"pinot"},"Pinot"),Object(o.b)("p",null,"This is a docker image of ",Object(o.b)("a",{parentName:"p",href:"https://github.com/apache/incubator-pinot"},"Apache Pinot")),Object(o.b)("h3",{id:"how-to-build-a-docker-image"},"How to build a docker image"),Object(o.b)("p",null,"There is a docker build script which will build a given Git repo/branch and tag the image."),Object(o.b)("p",null,"Usage:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-bash"},"./docker-build.sh [Docker Tag] [Git Branch] [Pinot Git URL]\n")),Object(o.b)("p",null,"This script will check out Pinot Repo ",Object(o.b)("inlineCode",{parentName:"p"},"[Pinot Git URL]")," on branch ",Object(o.b)("inlineCode",{parentName:"p"},"[Git Branch]")," and build the docker image for that. ",Object(o.b)("br",null),"\nThe docker image is tagged as ",Object(o.b)("inlineCode",{parentName:"p"},"[Docker Tag]"),". ",Object(o.b)("br",null),"\nDocker Tag: Name and tag your docker image. Default is ",Object(o.b)("inlineCode",{parentName:"p"},"pinot:latest"),". ",Object(o.b)("br",null),"\nGit Branch: The Pinot branch to build. Default is master. ",Object(o.b)("br",null),"\nPinot Git URL: The Pinot Git Repo to build, users can set it to their own fork. ",Object(o.b)("br",null),"\nPlease note that, the URL is ",Object(o.b)("inlineCode",{parentName:"p"},"https://")," based, not ",Object(o.b)("inlineCode",{parentName:"p"},"git://"),". ",Object(o.b)("br",null),"\nDefault is the ",Object(o.b)("a",{parentName:"p",href:"https://github.com/apache/incubator-pinot.git"},"Apache Repo: https://github.com/apache/incubator-pinot.git"),". ",Object(o.b)("br",null)),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"Example of building and tagging a snapshot on your own fork:")),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-bash"},"./docker-build.sh pinot_fork:snapshot-5.2 snapshot-5.2 https://github.com/your_own_fork/pinot.git\n")),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"Example of building a release version:")),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-bash"},"./docker-build.sh pinot:release-0.1.0 release-0.1.0 https://github.com/apache/incubator-pinot.git\n")),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"Example of building current master branch as a snapshot:")),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-bash"},"./docker-build.sh apachepinot/pinot:0.3.0-SNAPSHOT master\n")),Object(o.b)("h2",{id:"how-to-publish-a-docker-image"},"How to publish a docker image"),Object(o.b)("p",null,"Script ",Object(o.b)("inlineCode",{parentName:"p"},"docker-push.sh")," publishes a given docker image to your docker registry.\nIn order to push to your own repo, the image needs to be explicitly tagged with the repo name."),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"Example of publishing an image to ",Object(o.b)("inlineCode",{parentName:"li"},"[apachepinot/pinot](https://hub.docker.com/u/apachepinot/repository/docker/apachepinot/pinot)")," dockerHub repo.")),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-bash"},"./docker-push.sh apachepinot/pinot:latest\n")),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"You can also tag a built image, then push it.")),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-bash"},"docker tag pinot:release-0.1.0 apachepinot/pinot:release-0.1.0\ndocker push apachepinot/pinot:release-0.1.0\n")),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},"Script docker-build-and-push.sh builds and publishes this docker image to your docker registry after build.")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},"Example of building and publishing an image to ",Object(o.b)("inlineCode",{parentName:"p"},"[apachepinot/pinot](https://hub.docker.com/u/apachepinot/repository/docker/apachepinot/pinot)")," dockerHub repo."))),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-bash"},"./docker-build-and-push.sh apachepinot/pinot:latest master https://github.com/apache/incubator-pinot.git\n")),Object(o.b)("h2",{id:"kubernetes-examples"},"Kubernetes Examples"),Object(o.b)("p",null,"Please refer to ",Object(o.b)("a",{parentName:"p",href:"/docs/administration/installation/cloud/on-premise"},"Kubernetes Quickstart")," for deployment examples."),Object(o.b)("p",null,Object(o.b)("a",{parentName:"p",href:"/docs/administration/installation/cloud/on-premise"},"Kubernetes Quickstart")),Object(o.b)("h2",{id:"pinot-presto"},"Pinot Presto"),Object(o.b)("p",null,"Docker image for Presto with Pinot integration.\nThis docker build project is specialized for Pinot."),Object(o.b)("h3",{id:"how-to-build"},"How to build"),Object(o.b)("p",null,"Usage:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-bash"},"./docker-build.sh [Docker Tag] [Git Branch] [Presto Git URL]\n")),Object(o.b)("p",null,"This script will check out Pinot Repo ",Object(o.b)("inlineCode",{parentName:"p"},"[Pinot Git URL]")," on branch ",Object(o.b)("inlineCode",{parentName:"p"},"[Git Branch]")," and build the docker image for that. ",Object(o.b)("br",null),"\nThe docker image is tagged as ",Object(o.b)("inlineCode",{parentName:"p"},"[Docker Tag]"),". ",Object(o.b)("br",null),"\nDocker Tag: Name and tag your docker image. Default is ",Object(o.b)("inlineCode",{parentName:"p"},"pinot:latest"),". ",Object(o.b)("br",null),"\nGit Branch: The Pinot branch to build. Default is master. ",Object(o.b)("br",null),"\nPinot Git URL: The Pinot Git Repo to build, users can set it to their own fork. ",Object(o.b)("br",null),"\nPlease note that, the URL is ",Object(o.b)("inlineCode",{parentName:"p"},"https://")," based, not ",Object(o.b)("inlineCode",{parentName:"p"},"git://"),". ",Object(o.b)("br",null),"\nDefault is the ",Object(o.b)("a",{parentName:"p",href:"https://github.com/apache/incubator-pinot.git"},"Apache Repo: https://github.com/apache/incubator-pinot.git"),". ",Object(o.b)("br",null)),Object(o.b)("h3",{id:"how-to-push"},"How to push"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-bash"},"docker push apachepinot/pinot-presto:latest\n")),Object(o.b)("h3",{id:"configuration"},"Configuration"),Object(o.b)("p",null,"Follow the instructions provided by Presto for writing your own configuration files under etc directory."),Object(o.b)("h3",{id:"volumes"},"Volumes"),Object(o.b)("p",null,"The image defines two data volumes: one for mounting configuration into the container, and one for data.\nThe configuration volume is located alternatively at ",Object(o.b)("inlineCode",{parentName:"p"},"/home/presto/etc"),", which contains all the configuration and plugins.\nThe data volume is located at ",Object(o.b)("inlineCode",{parentName:"p"},"/home/presto/data"),"."),Object(o.b)("h3",{id:"kubernetes-examples-1"},"Kubernetes Examples"),Object(o.b)("p",null,"Please refer to presto-coordinator.yaml as k8s deployment example."),Object(o.b)("h2",{id:"pinot-superset"},"Pinot Superset"),Object(o.b)("p",null,"Docker image for Superset with Pinot integration.\nThis docker build project is based on Project docker-superset and specialized for Pinot."),Object(o.b)("h3",{id:"how-to-build-1"},"How to build"),Object(o.b)("p",null,"Please modify file ",Object(o.b)("inlineCode",{parentName:"p"},"Makefile")," to change image and ",Object(o.b)("inlineCode",{parentName:"p"},"superset_version")," accordingly.\nBelow command will build docker image and tag it as ",Object(o.b)("inlineCode",{parentName:"p"},"superset_version")," and ",Object(o.b)("inlineCode",{parentName:"p"},"latest"),"."),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-bash"},"make latest\n")),Object(o.b)("p",null,"You can also build directly with ",Object(o.b)("inlineCode",{parentName:"p"},"docker build")," command by setting arguments:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-bash"},"docker build \\\n --build-arg NODE_VERSION=latest \\\n --build-arg PYTHON_VERSION=3.6 \\\n --build-arg SUPERSET_VERSION=0.34.1 \\\n --tag apachepinot/pinot-superset:0.34.1 \\\n --target build .\n")),Object(o.b)("p",null,"How to push"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-bash"},"make push\n")),Object(o.b)("h3",{id:"configuration-1"},"Configuration"),Object(o.b)("p",null,"Follow the ",Object(o.b)("a",{parentName:"p",href:"https://superset.incubator.apache.org/installation.html#configuration"},"instructions")," provided by Apache Superset for writing your own superset_config.py."),Object(o.b)("p",null,"Place this file in a local directory and mount this directory to /etc/superset inside the container. This location\nis included in the image's ",Object(o.b)("inlineCode",{parentName:"p"},"PYTHONPATH"),". Mounting this file to a different location is possible, but it will need to be in the PYTHONPATH."),Object(o.b)("h3",{id:"volumes-1"},"Volumes"),Object(o.b)("p",null,"The image defines two data volumes: one for mounting configuration into the container, and one for data (logs, SQLite DBs, &c)."),Object(o.b)("p",null,"The configuration volume is located alternatively at ",Object(o.b)("inlineCode",{parentName:"p"},"/etc/superset")," or ",Object(o.b)("inlineCode",{parentName:"p"},"/home/superset"),"; either is acceptable. Both of these directories are included in the PYTHONPATH of the image. Mount any configuration (specifically the superset_config.py file) here to have it read by the app on startup."),Object(o.b)("p",null,"The data volume is located at ",Object(o.b)("inlineCode",{parentName:"p"},"/var/lib/superset")," and it is where you would mount your SQLite file (if you are using that as your backend), or a volume to collect any logs that are routed there. This location is used as the value of the ",Object(o.b)("inlineCode",{parentName:"p"},"SUPERSET_HOME")," environmental variable."),Object(o.b)("h3",{id:"kubernetes-examples-2"},"Kubernetes Examples"),Object(o.b)("p",null,"Please refer to superset.yaml as k8s deployment example."))}p.isMDXComponent=!0},129:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return h}));var a=n(0),i=n.n(a);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t){if(null==e)return{};var n,a,i=function(e,t){if(null==e)return{};var n,a,i={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var b=i.a.createContext({}),p=function(e){var t=i.a.useContext(b),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},u=function(e){var t=p(e.components);return i.a.createElement(b.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},d=i.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,r=e.parentName,b=c(e,["components","mdxType","originalType","parentName"]),u=p(n),d=a,h=u["".concat(r,".").concat(d)]||u[d]||s[d]||o;return n?i.a.createElement(h,l(l({ref:t},b),{},{components:n})):i.a.createElement(h,l({ref:t},b))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,r=new Array(o);r[0]=d;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l.mdxType="string"==typeof e?e:a,r[1]=l;for(var b=2;b<o;b++)r[b]=n[b];return i.a.createElement.apply(null,r)}return i.a.createElement.apply(null,n)}d.displayName="MDXCreateElement"}}]); |