mirror of
https://github.com/falk-werner/webfuse-example
synced 2024-10-27 20:44:09 +00:00
Merge pull request #3 from falk-werner/s6overlay
switched init system to s6-overlay
This commit is contained in:
commit
8e325a695b
32
Dockerfile
32
Dockerfile
@ -21,22 +21,23 @@ RUN set -x \
|
|||||||
|
|
||||||
ARG PARALLELMFLAGS=-j2
|
ARG PARALLELMFLAGS=-j2
|
||||||
|
|
||||||
ARG DUMB_INIT_VERSION=1.2.2
|
ARG S6OVERLAY_VERSION=1.22.1.0
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& builddeps="xxd" \
|
|
||||||
&& apt install --yes --no-install-recommends $builddeps \
|
|
||||||
&& builddir="/tmp/out" \
|
&& builddir="/tmp/out" \
|
||||||
&& mkdir -p "$builddir" \
|
&& mkdir -p "$builddir" \
|
||||||
&& cd "$builddir" \
|
&& cd "$builddir" \
|
||||||
&& wget "https://github.com/Yelp/dumb-init/archive/v${DUMB_INIT_VERSION}.tar.gz" -O dumb_init.tar.gz \
|
&& wget "https://github.com/just-containers/s6-overlay/releases/download/v${S6OVERLAY_VERSION}/s6-overlay-amd64.tar.gz" -O s6overlay.tar.gz \
|
||||||
&& tar -xf dumb_init.tar.gz \
|
&& tar -xf s6overlay.tar.gz -C / \
|
||||||
&& cd "dumb-init-$DUMB_INIT_VERSION" \
|
&& rm -rf "$builddir"
|
||||||
&& make "$PARALLELMFLAGS" \
|
|
||||||
&& chmod +x dumb-init \
|
ARG SOCKLOG_VERSION=3.1.0-2
|
||||||
&& mv dumb-init /usr/local/bin/dumb-init \
|
RUN set -x \
|
||||||
&& dumb-init --version \
|
&& builddir="/tmp/out" \
|
||||||
&& rm -rf "$builddir" \
|
&& mkdir -p "$builddir" \
|
||||||
&& apt purge -y $builddeps
|
&& cd "$builddir" \
|
||||||
|
&& wget "https://github.com/just-containers/socklog-overlay/releases/download/v${SOCKLOG_VERSION}/socklog-overlay-amd64.tar.gz" -O socklog.tar.gz \
|
||||||
|
&& tar -xf socklog.tar.gz -C / \
|
||||||
|
&& rm -rf "$builddir"
|
||||||
|
|
||||||
ARG FUSE_VERSION=3.9.1
|
ARG FUSE_VERSION=3.9.1
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
@ -120,8 +121,6 @@ RUN set -x \
|
|||||||
&& make "$PARALLELMFLAGS" install \
|
&& make "$PARALLELMFLAGS" install \
|
||||||
&& rm -rf "$builddir"
|
&& rm -rf "$builddir"
|
||||||
|
|
||||||
COPY webfused.conf /etc
|
|
||||||
|
|
||||||
ARG NPM_VERSION=">=6.14.0 <7.0.0"
|
ARG NPM_VERSION=">=6.14.0 <7.0.0"
|
||||||
ARG NODEJS_VERSION=12
|
ARG NODEJS_VERSION=12
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
@ -146,6 +145,9 @@ ARG USERID=1000
|
|||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& useradd -u "$USERID" -ms /bin/bash user
|
&& useradd -u "$USERID" -ms /bin/bash user
|
||||||
|
|
||||||
|
COPY etc /etc
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
ENTRYPOINT ["dumb-init", "--"]
|
ENTRYPOINT ["/init"]
|
||||||
|
CMD ["/usr/bin/execlineb", "-P", "-c", "emptyenv export HOME /home/user s6-setuidgid user /bin/bash"]
|
17
README.md
17
README.md
@ -11,17 +11,22 @@ Example of webfuse.
|
|||||||
|
|
||||||
docker run -p 8080:8080 --rm -it \
|
docker run -p 8080:8080 --rm -it \
|
||||||
--device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined \
|
--device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined \
|
||||||
--user `id -u` \
|
webfuse
|
||||||
webfuse bash
|
|
||||||
webfused -f /etc/webfused.conf
|
|
||||||
|
|
||||||
Open a webbrowser and visit http://localhost:8080 and follow the instruction on the screen.
|
Open a webbrowser and visit http://localhost:8080 and establish a connection.
|
||||||
|
|
||||||
Then open another terminal and connect to the container.
|
Once connected, you can display the provided filesystem inside the container.
|
||||||
|
|
||||||
docker exec -it <name of container> bash
|
|
||||||
cat /tmp/test/hello.txt
|
cat /tmp/test/hello.txt
|
||||||
|
|
||||||
|
### Logging
|
||||||
|
|
||||||
|
To view log messages from webfuse, open another terminal an conntect to the container.
|
||||||
|
Log files can be found in /var/log/socklog/daemon directory.
|
||||||
|
|
||||||
|
docker exec -it <container> bash
|
||||||
|
tail -f /var/log/socklog/daemon/current
|
||||||
|
|
||||||
## Fellow Repositories
|
## Fellow Repositories
|
||||||
|
|
||||||
* [webfuse library](https://github.com/falk-werner/webfuse)
|
* [webfuse library](https://github.com/falk-werner/webfuse)
|
||||||
|
4
etc/services.d/webfused/run
Normal file
4
etc/services.d/webfused/run
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/execlineb -P
|
||||||
|
|
||||||
|
s6-setuidgid user
|
||||||
|
/usr/local/bin/webfused -f /etc/webfused.conf
|
@ -16,6 +16,12 @@ filesystems:
|
|||||||
|
|
||||||
log:
|
log:
|
||||||
{
|
{
|
||||||
provider: "stderr"
|
provider: "syslog"
|
||||||
level: "all"
|
level: "all"
|
||||||
|
settings:
|
||||||
|
{
|
||||||
|
ident: "webfused"
|
||||||
|
facility: "daemon"
|
||||||
|
log_pid: true
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user