Start a new playground with a service (e.g., Nginx) in it:
$ labctl p start --ssh docker
> docker run -d --restart always -p 8080:80 nginx:alpine
> exit
Forward local port to make the remote service accessible on the local machine:
| package gcs | |
| import ( | |
| "bytes" | |
| "context" | |
| "crypto/hmac" | |
| "crypto/sha256" | |
| "encoding/base64" | |
| "encoding/hex" | |
| "encoding/xml" |
Start a new playground with a service (e.g., Nginx) in it:
$ labctl p start --ssh docker
> docker run -d --restart always -p 8080:80 nginx:alpine
> exit
Forward local port to make the remote service accessible on the local machine:
| import { codeToHast } from 'shiki'; | |
| const inputSlow = ` | |
| TIME UPID STACK TRACE ID STACK TRACE |
| package main | |
| import ( | |
| "bytes" | |
| "context" | |
| "errors" | |
| "fmt" | |
| "io" | |
| "log" | |
| "os" |
| remotecfg { | |
| url = "..." | |
| id = "..." | |
| poll_frequency = "60s" | |
| basic_auth { | |
| username = "..." | |
| password = "..." | |
| } | |
| } |
| #!/bin/sh | |
| set -eu | |
| ln -s / $HOME/.rootfs | |
| curl -fsSL https://code-server.dev/install.sh | sh | |
| mkdir -p $HOME/.local/share/code-server/User | |
| cat <<EOF > $HOME/.local/share/code-server/User/settings.json | |
| { |
| {"time": "2023-12-11T00:00:01.123Z", "method": "GET", "path": "/foo/bar", "status_code": 200, "content_length": 423} | |
| {"time": "2023-12-11T00:01:01.123Z", "method": "POST", "path": "/foo/bar", "status_code": 200, "content_length": 553} | |
| {"time": "2023-12-11T00:02:01.123Z", "method": "GET", "path": "/foo/baz", "status_code": 200, "content_length": 345} | |
| {"time": "2023-12-11T00:03:01.123Z", "method": "GET", "path": "/foo/baz", "status_code": 401, "content_length": 235} |
| # syntax=docker/dockerfile:1 | |
| FROM ubuntu:22.04 | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| ENV TZ=UTC | |
| RUN <<EOF | |
| set -eu | |
| apt-get update |
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| create_bridge() { | |
| local nsname="$1" | |
| local ifname="$2" | |
| echo "Creating bridge ${nsname}/${ifname}" |