[Makefile]: Add possibility for docker containers to install files to base image (#240)
- Add vtysh/lldpctl/sensors to baseimage
This commit is contained in:
parent
522585aadf
commit
53a9792014
2
dockers/docker-fpm/base_image_files/vtysh
Executable file
2
dockers/docker-fpm/base_image_files/vtysh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
docker exec -i bgp vtysh "$@"
|
2
dockers/docker-lldp-sv2/base_image_files/lldpctl
Executable file
2
dockers/docker-lldp-sv2/base_image_files/lldpctl
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
docker exec -it lldp lldpctl "$@"
|
2
dockers/docker-platform-monitor/base_image_files/sensors
Executable file
2
dockers/docker-platform-monitor/base_image_files/sensors
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
docker exec -i pmon sensors "$@"
|
@ -117,3 +117,11 @@ sudo LANG=C chroot $FILESYSTEM_ROOT fuser -km /sys || true
|
|||||||
sudo LANG=C chroot $FILESYSTEM_ROOT umount -lf /sys
|
sudo LANG=C chroot $FILESYSTEM_ROOT umount -lf /sys
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% for file in installer_extra_files.split(' ') -%}
|
||||||
|
{% if file.strip() -%}
|
||||||
|
{% set src = file.split(':')[0] -%}
|
||||||
|
{% set dst = file.split(':')[1] -%}
|
||||||
|
sudo cp {{src}} $FILESYSTEM_ROOT/{{dst}}
|
||||||
|
{% endif -%}
|
||||||
|
{% endfor -%}
|
||||||
|
|
||||||
|
@ -11,3 +11,5 @@ $(DOCKER_FPM)_CONTAINER_NAME = bgp
|
|||||||
$(DOCKER_FPM)_RUN_OPT += --net=host --privileged -t
|
$(DOCKER_FPM)_RUN_OPT += --net=host --privileged -t
|
||||||
$(DOCKER_FPM)_RUN_OPT += --volumes-from database
|
$(DOCKER_FPM)_RUN_OPT += --volumes-from database
|
||||||
$(DOCKER_FPM)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
|
$(DOCKER_FPM)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
|
||||||
|
|
||||||
|
$(DOCKER_FPM)_BASE_IMAGE_FILES += vtysh:/usr/bin/vtysh
|
||||||
|
@ -11,3 +11,5 @@ SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_LLDP_SV2)
|
|||||||
$(DOCKER_LLDP_SV2)_CONTAINER_NAME = lldp
|
$(DOCKER_LLDP_SV2)_CONTAINER_NAME = lldp
|
||||||
$(DOCKER_LLDP_SV2)_RUN_OPT += --net=host --privileged -t
|
$(DOCKER_LLDP_SV2)_RUN_OPT += --net=host --privileged -t
|
||||||
$(DOCKER_LLDP_SV2)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
|
$(DOCKER_LLDP_SV2)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
|
||||||
|
|
||||||
|
$(DOCKER_LLDP_SV2)_BASE_IMAGE_FILES += lldpctl:/usr/bin/lldpctl
|
||||||
|
@ -11,3 +11,5 @@ SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_PLATFORM_MONITOR)
|
|||||||
$(DOCKER_PLATFORM_MONITOR)_CONTAINER_NAME = pmon
|
$(DOCKER_PLATFORM_MONITOR)_CONTAINER_NAME = pmon
|
||||||
$(DOCKER_PLATFORM_MONITOR)_RUN_OPT += --net=host --privileged -t
|
$(DOCKER_PLATFORM_MONITOR)_RUN_OPT += --net=host --privileged -t
|
||||||
$(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
|
$(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
|
||||||
|
|
||||||
|
$(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += sensors:/usr/bin/sensors
|
||||||
|
1
slave.mk
1
slave.mk
@ -309,6 +309,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : .platform
|
|||||||
|
|
||||||
export installer_start_scrips="$(foreach docker, $($*_DOCKERS),$(addsuffix .sh, $($(docker)_CONTAINER_NAME)))"
|
export installer_start_scrips="$(foreach docker, $($*_DOCKERS),$(addsuffix .sh, $($(docker)_CONTAINER_NAME)))"
|
||||||
export installer_services="$(foreach docker, $($*_DOCKERS),$(addsuffix .service, $($(docker)_CONTAINER_NAME)))"
|
export installer_services="$(foreach docker, $($*_DOCKERS),$(addsuffix .service, $($(docker)_CONTAINER_NAME)))"
|
||||||
|
export installer_extra_files="$(foreach docker, $($*_DOCKERS), $(foreach file, $($(docker)_BASE_IMAGE_FILES), $($(docker)_PATH)/base_image_files/$(file)))"
|
||||||
|
|
||||||
j2 -f env files/initramfs-tools/union-mount.j2 onie-image.conf > files/initramfs-tools/union-mount
|
j2 -f env files/initramfs-tools/union-mount.j2 onie-image.conf > files/initramfs-tools/union-mount
|
||||||
j2 -f env files/initramfs-tools/arista-convertfs.j2 onie-image.conf > files/initramfs-tools/arista-convertfs
|
j2 -f env files/initramfs-tools/arista-convertfs.j2 onie-image.conf > files/initramfs-tools/arista-convertfs
|
||||||
|
Loading…
Reference in New Issue
Block a user