Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
Twoje Imię Nazwisko | fd82f97ac0 | |
filih | cf225129a5 |
|
@ -28,9 +28,9 @@ RUN apt-get update && apt-get install -y \
|
||||||
RUN echo "root:rootpass" | chpasswd
|
RUN echo "root:rootpass" | chpasswd
|
||||||
|
|
||||||
# Tworzenie nowego użytkownika 'user' z hasłem 'pass' i dodanie do grupy sudo
|
# Tworzenie nowego użytkownika 'user' z hasłem 'pass' i dodanie do grupy sudo
|
||||||
RUN useradd -m -s /bin/bash user && \
|
#RUN useradd -m -s /bin/bash user && \
|
||||||
echo "user:pass" | chpasswd && \
|
# echo "user:pass" | chpasswd && \
|
||||||
usermod -aG sudo user
|
# usermod -aG sudo user
|
||||||
|
|
||||||
# Opcjonalnie: Ustawienie domyślnego użytkownika
|
# Opcjonalnie: Ustawienie domyślnego użytkownika
|
||||||
# USER user
|
# USER user
|
||||||
|
@ -38,3 +38,4 @@ RUN useradd -m -s /bin/bash user && \
|
||||||
# Ustawienie domyślnego polecenia
|
# Ustawienie domyślnego polecenia
|
||||||
CMD ["/bin/bash"]
|
CMD ["/bin/bash"]
|
||||||
|
|
||||||
|
|
||||||
|
|
2
__vp
2
__vp
|
@ -1,6 +1,6 @@
|
||||||
f() {
|
f() {
|
||||||
sudo docker run --rm -dit --privileged \
|
sudo docker run --rm -dit --privileged \
|
||||||
-v "$(pwd)/app:/home/user/work" \
|
-v "$(pwd)/../app:/home/user/work" \
|
||||||
-p 3333:3333 \
|
-p 3333:3333 \
|
||||||
--name "$1" deb su - user;
|
--name "$1" deb su - user;
|
||||||
};
|
};
|
||||||
|
|
1
app
1
app
|
@ -1 +0,0 @@
|
||||||
Subproject commit db0752d3e05f90f7fd8dda802b2366f3c6942b87
|
|
|
@ -0,0 +1 @@
|
||||||
|
git submodule add -b z1 http://t:f6ad1fe79d0b929d8def3339dafcbf919f311acf@qstack.pl:3000/c2023/p22.10 app
|
|
@ -0,0 +1 @@
|
||||||
|
f() { sudo docker run --rm -dit --privileged --name "$1" deb su - user; }; f deb1
|
|
@ -0,0 +1,6 @@
|
||||||
|
f() {
|
||||||
|
sudo docker run --rm -dit --privileged \
|
||||||
|
-v "$(pwd)/app:/home/user/work" \
|
||||||
|
--name "$1" deb su - user;
|
||||||
|
};
|
||||||
|
f $1
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue