mirror of
https://github.com/openziti/zrok.git
synced 2025-01-24 23:09:32 +01:00
1 line
9.5 KiB
JavaScript
1 line
9.5 KiB
JavaScript
|
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6332],{2452:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>u,frontMatter:()=>c,metadata:()=>s,toc:()=>d});const s=JSON.parse('{"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":false,"unlisted":false,"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"}}');var t=r(4848),o=r(8453),i=r(4971);const c={title:"Getting Started with Docker"},a=void 0,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,o.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h2,{id:"overview",children:"Overview"}),"\n",(0,t.jsxs)(n.p,{children:["To follow the guides in this section you will need ",(0,t.jsx)(n.a,{href:"https://docs.docker.com/get-docker/",children:"Docker"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["You have the option to enable a ",(0,t.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,t.jsx)(n.code,{children:"compose.yml"}),") to enable a separate ",(0,t.jsx)(n.code,{children:"zrok"})," environment for each project."]}),"\n",(0,t.jsxs)(n.p,{children:["This page provides ",(0,t.jsx)(n.code,{children:"docker"})," and ",(0,t.jsx)(n.code,{children:"docker compose"})," examples of mounting the host's ",(0,t.jsx)(n.code,{children:"zrok"})," environment on the container. You'll need to first ",(0,t.jsx)(n.a,{href:"/docs/getting-started/#installing-the-zrok-command",children:"enable zrok on the Docker host"})," to use this approach."]}),"\n",(0,t.jsx)(n.h2,{id:"permanent-public-share",children:"Permanent Public Share"}),"\n",(0,t.jsxs)(n.p,{children:["Let's say you have a ",(0,t.jsx)(n.code,{children:"compose.yml"})," file that defines a web app known within the project's bridge network as ",(0,t.jsx)(n.code,{children:"https://myapp:8080"})," and you want to publish it as a reliable, public site."]}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Reserve a subdomain by running ",(0,t.jsx)(n.code,{children:'zrok reserve public --unique-name "myapp" https://myapp:8080'})," on the Docker host."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Merge this YAML with ",(0,t.jsx)(n.code,{children:"compose.yml"})," or save it in the same directory as ",(0,t.jsx)(n.code,{children:"compose.override.yml"})," to let ",(0,t.jsx)(n.code,{children:"docker compose up"})," merge it for you."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.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,t.jsxs)(n.p,{children:["The reserved share will be available at ",(0,t.jsx)(n.code,{children:"https://myapp.share.zrok.io"})," each time the ",(0,t.jsx)(n.code,{children:"zrok"})," container starts up."]}),"\n",(0,t.jsx)(n.h2,{id:"temporary-public-share",children:"Temporary Public Share"}),"\n",(0,t.jsxs)(n.p,{children:["Let's say you have a web server running on the host's private network at ",(0,t.jsx)(n.code,{children:"https://10.11.12.13:8080"}),". With one addition
|