zrok/assets/js/2da89d45.0235cd0f.js

1 line
9.5 KiB
JavaScript
Raw Normal View History

"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5893],{6402:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>u,frontMatter:()=>i,metadata:()=>a,toc:()=>d});var s=r(5893),t=r(1151),o=r(5471);const i={title:"Getting Started with Docker"},c=void 0,a={id:"guides/docker-share/index",title:"Getting Started with Docker",description:"Overview",source:"@site/../docs/guides/docker-share/index.mdx",sourceDirName:"guides/docker-share",slug:"/guides/docker-share/",permalink:"/docs/guides/docker-share/",draft:!1,unlisted:!1,editUrl:"https://github.com/openziti/zrok/blob/main/docs/../docs/guides/docker-share/index.mdx",tags:[],version:"current",frontMatter:{title:"Getting Started with Docker"},sidebar:"tutorialSidebar",previous:{title:"Permission Modes",permalink:"/docs/guides/permission-modes"},next:{title:"Public Share",permalink:"/docs/guides/docker-share/docker_public_share_guide"}},l={},d=[{value:"Overview",id:"overview",level:2},{value:"Permanent Public Share",id:"permanent-public-share",level:2},{value:"Temporary Public Share",id:"temporary-public-share",level:2}];function h(e){const n={a:"a",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"overview",children:"Overview"}),"\n",(0,s.jsxs)(n.p,{children:["To follow the guides in this section you will need ",(0,s.jsx)(n.a,{href:"https://docs.docker.com/get-docker/",children:"Docker"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["You have the option to enable a ",(0,s.jsx)(n.code,{children:"zrok"})," account on the Docker host and mount it on the container or you can use the provided Docker Compose project files (",(0,s.jsx)(n.code,{children:"compose.yml"}),") to enable a separate ",(0,s.jsx)(n.code,{children:"zrok"})," environment for each project."]}),"\n",(0,s.jsxs)(n.p,{children:["This page provides ",(0,s.jsx)(n.code,{children:"docker"})," and ",(0,s.jsx)(n.code,{children:"docker compose"})," examples of mounting the host's ",(0,s.jsx)(n.code,{children:"zrok"})," environment on the container. You'll need to first ",(0,s.jsx)(n.a,{href:"/docs/getting-started/#installing-the-zrok-command",children:"enable zrok on the Docker host"})," to use this approach."]}),"\n",(0,s.jsx)(n.h2,{id:"permanent-public-share",children:"Permanent Public Share"}),"\n",(0,s.jsxs)(n.p,{children:["Let's say you have a ",(0,s.jsx)(n.code,{children:"compose.yml"})," file that defines a web app known within the project's bridge network as ",(0,s.jsx)(n.code,{children:"https://myapp:8080"})," and you want to publish it as a reliable, public site."]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Reserve a subdomain by running ",(0,s.jsx)(n.code,{children:'zrok reserve public --unique-name "myapp" https://myapp:8080'})," on the Docker host."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Merge this YAML with ",(0,s.jsx)(n.code,{children:"compose.yml"})," or save it in the same directory as ",(0,s.jsx)(n.code,{children:"compose.override.yml"})," to let ",(0,s.jsx)(n.code,{children:"docker compose up"})," merge it for you."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-yaml",children:'services:\n zrok:\n image: openziti/zrok\n restart: unless-stopped\n user: "${UID}"\n volumes:\n - ${HOME}/.zrok:/.zrok\n environment:\n PFXLOG_NO_JSON: "true"\n command: share reserved "myapp" --headless\n'})}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["The reserved share will be available at ",(0,s.jsx)(n.code,{children:"https://myapp.share.zrok.io"})," each time the ",(0,s.jsx)(n.code,{children:"zrok"})," container starts up."]}),"\n",(0,s.jsx)(n.h2,{id:"temporary-public-share",children:"Temporary Public Share"}),"\n",(0,s.jsxs)(n.p,{children:["Let's say you have a web server running on the host's private network at ",(0,s.jsx)(n.code,{children:"https://10.11.12.13:8080"}),". With one additional ",(0,s.jsx)(n.code,{children:"docker"})," command, you can share