Fix quagga container
The quagga container failed to work because docker now seems to reset the permissions of the /run folder on starting. The solution is to set the permissions in the startup script. Use the opportunity to switch to a newer base container. We cannot go beyond ubuntu:20.04 though, since after that quagga has been replaced by frr, which will require some deeper changes. Change-Id: I6bbd88c0d66bffa0a310364e26cd73286524fee3
This commit is contained in:
parent
e9dc289d33
commit
17570b4c24
|
@ -140,7 +140,7 @@ class Command(object):
|
|||
|
||||
|
||||
class DockerImage(object):
|
||||
def __init__(self, baseimage='ubuntu:16.04'):
|
||||
def __init__(self, baseimage='ubuntu:20.04'):
|
||||
self.baseimage = baseimage
|
||||
self.cmd = Command()
|
||||
|
||||
|
@ -171,7 +171,7 @@ class DockerImage(object):
|
|||
pkges = ' '.join([
|
||||
'telnet',
|
||||
'tcpdump',
|
||||
'quagga',
|
||||
'quagga-bgpd',
|
||||
])
|
||||
if image:
|
||||
use_image = image
|
||||
|
@ -181,7 +181,13 @@ class DockerImage(object):
|
|||
c << 'FROM %s' % use_image
|
||||
c << 'RUN apt-get update'
|
||||
c << 'RUN apt-get install -qy --no-install-recommends %s' % pkges
|
||||
c << 'CMD /usr/lib/quagga/bgpd'
|
||||
c << 'RUN echo "#!/bin/sh" > /bgpd'
|
||||
c << 'RUN echo mkdir -p /run/quagga >> /bgpd'
|
||||
c << 'RUN echo chmod 755 /run/quagga >> /bgpd'
|
||||
c << 'RUN echo chown quagga:quagga /run/quagga >> /bgpd'
|
||||
c << 'RUN echo exec /usr/sbin/bgpd >> /bgpd'
|
||||
c << 'RUN chmod +x /bgpd'
|
||||
c << 'CMD /bgpd'
|
||||
|
||||
self.cmd.sudo('rm -rf %s' % workdir)
|
||||
self.cmd.execute('mkdir -p %s' % workdir)
|
||||
|
|
Loading…
Reference in New Issue