mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
proxy uncloud.sock socket to tcp port when running machine in container
This commit is contained in:
@@ -37,6 +37,7 @@ RUN crane pull "${CORROSION_IMAGE}" /corrosion.tar
|
|||||||
|
|
||||||
FROM docker:27.3.1-dind AS machine
|
FROM docker:27.3.1-dind AS machine
|
||||||
RUN apk --no-cache add \
|
RUN apk --no-cache add \
|
||||||
|
socat \
|
||||||
wireguard-tools
|
wireguard-tools
|
||||||
# Create system group and user 'uncloud'.
|
# Create system group and user 'uncloud'.
|
||||||
RUN addgroup -S uncloud && adduser -SHD -h /nonexistent -G uncloud -g "" uncloud
|
RUN addgroup -S uncloud && adduser -SHD -h /nonexistent -G uncloud -g "" uncloud
|
||||||
|
|||||||
@@ -9,4 +9,8 @@ echo "Docker in Docker is ready."
|
|||||||
echo "Loading corrosion image from /images/corrosion.tar..."
|
echo "Loading corrosion image from /images/corrosion.tar..."
|
||||||
docker load < /images/corrosion.tar
|
docker load < /images/corrosion.tar
|
||||||
|
|
||||||
|
# Make machine API accessible from the host via port publishing.
|
||||||
|
echo "Proxying Uncloud API port 51000/tcp to Unix socket /run/uncloud/uncloud.sock..."
|
||||||
|
socat TCP-LISTEN:51000,reuseaddr,fork,bind="$(hostname -i)" UNIX-CONNECT:/run/uncloud/uncloud.sock &
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user