File tree 2 files changed +23
-10
lines changed
2 files changed +23
-10
lines changed Original file line number Diff line number Diff line change 1
1
FROM alpine:latest
2
2
3
- RUN apk add --update openvswitch nano && rm -rf /var/cache/apk/*
3
+ RUN apk add --no-cache openvswitch nano bash bash-completion
4
+
5
+ # Make bash the default shell
6
+ RUN sed -i s,/bin/ash,/bin/bash, /etc/passwd
7
+
8
+ # Enable bash completion
9
+ RUN echo -e "source /etc/profile.d/bash_completion.sh" >> ~/.bashrc
10
+
11
+ # Enable openvswitch bash completion
12
+ RUN echo -e "source /usr/share/bash-completion/completions/ovs-vsctl-bashcomp.bash" >> ~/.bashrc
13
+ RUN echo -e "source /usr/share/bash-completion/completions/ovs-appctl-bashcomp.bash" >> ~/.bashrc
14
+
15
+ # Configure the prompt
16
+ RUN echo -e "PS1='\h :\w\$ '" >> ~/.bashrc
4
17
5
18
RUN mkdir /var/run/openvswitch
6
19
7
20
VOLUME /etc/openvswitch/
8
21
9
22
ADD boot.sh /bin/boot.sh
10
23
11
- CMD /bin/sh /bin/boot.sh
24
+ CMD /bin/bash /bin/boot.sh
Original file line number Diff line number Diff line change 1
- #! /bin/sh
1
+ #! /bin/bash
2
2
#
3
- # Copyright (C) 2015 GNS3 Technologies Inc.
3
+ # Copyright (C) 2024 GNS3 Technologies Inc.
4
4
#
5
5
# This program is free software: you can redistribute it and/or modify
6
6
# it under the terms of the GNU General Public License as published by
16
16
# along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
18
18
19
- if [ ! -f " /etc/openvswitch/conf.db" ]
19
+ if [[ ! -f " /etc/openvswitch/conf.db" ] ]
20
20
then
21
21
ovsdb-tool create /etc/openvswitch/conf.db /usr/share/openvswitch/vswitch.ovsschema
22
22
25
25
ovs-vsctl --no-wait init
26
26
27
27
x=0
28
- until [ $x = " 4" ]; do
28
+ until [[ $x = " 4" ] ]; do
29
29
ovs-vsctl add-br br$x
30
30
ovs-vsctl set bridge br$x datapath_type=netdev
31
31
x=$(( x+ 1 ))
32
32
done
33
33
34
- if [ $MANAGEMENT_INTERFACE == 1 ]
34
+ if [[ $MANAGEMENT_INTERFACE == 1 ] ]
35
35
then
36
36
x=1
37
37
else
38
38
x=0
39
39
fi
40
40
41
- until [ $x = " 16" ]; do
41
+ until [[ $x = " 16" ] ]; do
42
42
ovs-vsctl add-port br0 eth$x
43
43
x=$(( x+ 1 ))
44
44
done
49
49
50
50
51
51
x=0
52
- until [ $x = " 4" ]; do
52
+ until [[ $x = " 4" ] ]; do
53
53
ip link set dev br$x up
54
54
x=$(( x+ 1 ))
55
55
done
56
56
57
- /bin/sh
57
+ /bin/bash
You can’t perform that action at this time.
0 commit comments