Skip to content

Commit

Permalink
with fix for gvisor-tap-vsock
Browse files Browse the repository at this point in the history
  • Loading branch information
sakai135 committed Mar 14, 2023
1 parent fba15a7 commit f26b857
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 12 deletions.
15 changes: 11 additions & 4 deletions distro/alpine.dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
FROM docker.io/library/golang:1.20.0-alpine as build
# FROM docker.io/library/alpine:3.17.2 as gvisor-tap-vsock
# WORKDIR /app/bin
# RUN wget -O gvproxy-windows.exe https://github.com/containers/gvisor-tap-vsock/releases/download/v0.6.0/gvproxy-windows.exe && \
# wget -O vm https://github.com/containers/gvisor-tap-vsock/releases/download/v0.6.0/vm && \
# chmod +x ./gvproxy-windows.exe ./vm
# RUN find . -type f -exec sha256sum {} \;

FROM docker.io/library/golang:1.20.0-alpine as gvisor-tap-vsock
WORKDIR /app
RUN apk add git make
RUN git clone https://github.com/containers/gvisor-tap-vsock.git --single-branch /app
RUN git clone https://github.com/sakai135/gvisor-tap-vsock.git --single-branch --branch fix-stdio /app
RUN make && make cross
RUN find ./bin -type f -exec sha256sum {} \;

Expand All @@ -12,8 +19,8 @@ RUN apk update && \
apk list --installed && \
rm -rf /var/cache/apk/*
WORKDIR /app
COPY --from=build /app/bin/vm ./wsl-vm
COPY --from=build /app/bin/gvproxy-windows.exe ./wsl-gvproxy.exe
COPY --from=gvisor-tap-vsock /app/bin/vm ./wsl-vm
COPY --from=gvisor-tap-vsock /app/bin/gvproxy-windows.exe ./wsl-gvproxy.exe
COPY ./wsl-vpnkit ./wsl-vpnkit.service ./
COPY ./distro/wsl.conf /etc/wsl.conf
ARG REF=https://example.com/
Expand Down
15 changes: 11 additions & 4 deletions distro/fedora.dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
FROM docker.io/library/golang:1.20.0-alpine as build
# FROM docker.io/library/golang:1.20.0-alpine as gvisor-tap-vsock
# WORKDIR /app
# RUN apk add git make
# RUN git clone https://github.com/containers/gvisor-tap-vsock.git --single-branch /app
# RUN make && make cross
# RUN find ./bin -type f -exec sha256sum {} \;

FROM docker.io/library/golang:1.20.0-alpine as gvisor-tap-vsock
WORKDIR /app
RUN apk add git make
RUN git clone https://github.com/containers/gvisor-tap-vsock.git --single-branch /app
RUN git clone https://github.com/sakai135/gvisor-tap-vsock.git --single-branch --branch fix-stdio /app
RUN make && make cross
RUN find ./bin -type f -exec sha256sum {} \;

Expand All @@ -10,8 +17,8 @@ RUN dnf upgrade -y && \
dnf install -y iproute iptables-legacy iputils bind-utils wget && \
dnf clean all
WORKDIR /app
COPY --from=build /app/bin/vm ./wsl-vm
COPY --from=build /app/bin/gvproxy-windows.exe ./wsl-gvproxy.exe
COPY --from=gvisor-tap-vsock /app/bin/vm ./wsl-vm
COPY --from=gvisor-tap-vsock /app/bin/gvproxy-windows.exe ./wsl-gvproxy.exe
COPY ./wsl-vpnkit ./wsl-vpnkit.service ./
COPY ./distro/wsl.conf /etc/wsl.conf
RUN ln -s /app/wsl-vpnkit /usr/bin/
15 changes: 11 additions & 4 deletions distro/ubuntu.dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
FROM docker.io/library/golang:1.20.0-alpine as build
# FROM docker.io/library/golang:1.20.0-alpine as gvisor-tap-vsock
# WORKDIR /app
# RUN apk add git make
# RUN git clone https://github.com/containers/gvisor-tap-vsock.git --single-branch /app
# RUN make && make cross
# RUN find ./bin -type f -exec sha256sum {} \;

FROM docker.io/library/golang:1.20.0-alpine as gvisor-tap-vsock
WORKDIR /app
RUN apk add git make
RUN git clone https://github.com/containers/gvisor-tap-vsock.git --single-branch /app
RUN git clone https://github.com/sakai135/gvisor-tap-vsock.git --single-branch --branch fix-stdio /app
RUN make && make cross
RUN find ./bin -type f -exec sha256sum {} \;

Expand All @@ -11,8 +18,8 @@ RUN apt-get update && \
apt-get install -y iproute2 iptables iputils-ping dnsutils wget && \
apt-get clean
WORKDIR /app
COPY --from=build /app/bin/vm ./wsl-vm
COPY --from=build /app/bin/gvproxy-windows.exe ./wsl-gvproxy.exe
COPY --from=gvisor-tap-vsock /app/bin/vm ./wsl-vm
COPY --from=gvisor-tap-vsock /app/bin/gvproxy-windows.exe ./wsl-gvproxy.exe
COPY ./wsl-vpnkit ./wsl-vpnkit.service ./
COPY ./distro/wsl.conf /etc/wsl.conf
RUN ln -s /app/wsl-vpnkit /usr/bin/

0 comments on commit f26b857

Please sign in to comment.