Compare commits

...

2 Commits

Author SHA1 Message Date
mpabi f486ad61fc l. p25.10 update cloud 2024-10-25 12:52:30 +00:00
filih cf225129a5 added expose-nets 2024-10-23 09:09:50 +02:00
8 changed files with 59 additions and 4 deletions

View File

@ -33,7 +33,24 @@ RUN useradd -m -s /bin/bash user && \
usermod -aG sudo user
# Opcjonalnie: Ustawienie domyślnego użytkownika
# USER user
USER user
# Install Vim-Plug for Vim plugin management
RUN curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
# Copy the project into the image
#COPY --chown=user:user . /home/user/fapi
#COPY --chown=user:user ./_confs/* ./
COPY ./_confs/* ./
# Install Vim plugins via Vim-Plug
RUN vim +'PlugInstall --sync' +qall
# Set the working directory for installing dependencies
WORKDIR /home/user/work
# Ustawienie domyślnego polecenia
CMD ["/bin/bash"]

4
__vp
View File

@ -1,7 +1,7 @@
f() {
sudo docker run --rm -dit --privileged \
-v "$(pwd)/app:/home/user/work" \
-p 3333:3333 \
-v "$(pwd)/../app:/home/user/work" \
-p 4321:4321\
--name "$1" deb su - user;
};
f $1

1
app

@ -1 +0,0 @@
Subproject commit db0752d3e05f90f7fd8dda802b2366f3c6942b87

1
doc/git-log.txt Normal file
View File

@ -0,0 +1 @@
git submodule add -b z1 http://t:f6ad1fe79d0b929d8def3339dafcbf919f311acf@qstack.pl:3000/c2023/p22.10 app

1
run/__ Normal file
View File

@ -0,0 +1 @@
f() { sudo docker run --rm -dit --privileged --name "$1" deb su - user; }; f deb1

6
run/__v Normal file
View File

@ -0,0 +1,6 @@
f() {
sudo docker run --rm -dit --privileged \
-v "$(pwd)/app:/home/user/work" \
--name "$1" deb su - user;
};
f $1

7
run/__vp Normal file
View File

@ -0,0 +1,7 @@
f() {
sudo docker run --rm -dit --privileged \
-v "$(pwd)/app:/home/user/work" \
-p 3333:3333 \
--name "$1" deb su - user;
};
f $1

24
script/expose-netns.sh Normal file
View File

@ -0,0 +1,24 @@
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: $0 <container id or name>"
exit 1
fi
echo "expose container $1 netns"
NETNS=`sudo docker inspect -f '{{.State.Pid}}' $1`
if [ ! -d /var/run/netns ]; then
sudo mkdir /var/run/netns
fi
if [ -f /var/run/netns/$NETNS ]; then
sudo rm -rf /var/run/netns/$NETNS
fi
sudo ln -s /proc/$NETNS/ns/net /var/run/netns/$NETNS
echo "done. netns: $NETNS"
echo "============================="
echo "current network namespaces: "
echo "============================="
ip netns