From c0e292ecd208f19a7f4604bfa5e6930091b9a717 Mon Sep 17 00:00:00 2001 From: pavel-shirshov Date: Mon, 17 Apr 2017 17:27:42 -0700 Subject: [PATCH] [docker-syncd-rpc]: Fix Dockerfile (#513) * Use dpkg_apt properly * Remove unused dpkg_apt * Purge not remove previous version of syncd --- platform/broadcom/docker-syncd-brcm-rpc/Dockerfile.j2 | 6 ++---- platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/platform/broadcom/docker-syncd-brcm-rpc/Dockerfile.j2 b/platform/broadcom/docker-syncd-brcm-rpc/Dockerfile.j2 index 912f52cf73..40c573f09c 100644 --- a/platform/broadcom/docker-syncd-brcm-rpc/Dockerfile.j2 +++ b/platform/broadcom/docker-syncd-brcm-rpc/Dockerfile.j2 @@ -9,12 +9,11 @@ debs/{{ deb }}{{' '}} {%- endfor -%} debs/ -RUN dpkg -r syncd +RUN dpkg -P syncd RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ -dpkg_apt \ {% for deb in docker_syncd_brcm_rpc_debs.split(' ') -%} -debs/{{ deb }}{{' '}} +dpkg_apt debs/{{ deb }}{{'; '}} {%- endfor %} ## Pre-install the fundamental packages @@ -45,7 +44,6 @@ RUN apt-get update \ && mkdir -p /opt \ && cd /opt \ && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \ - && dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } \ && apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y \ && rm -rf /deps diff --git a/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 b/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 index 15c998385a..64e2081127 100644 --- a/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 +++ b/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 @@ -9,12 +9,11 @@ debs/{{ deb }}{{' '}} {%- endfor -%} debs/ -RUN dpkg -r syncd +RUN dpkg -P syncd RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ -dpkg_apt \ {% for deb in docker_syncd_mlnx_rpc_debs.split(' ') -%} -debs/{{ deb }}{{' '}} +dpkg_apt debs/{{ deb }}{{'; '}} {%- endfor %} ## Pre-install the fundamental packages @@ -45,7 +44,6 @@ RUN apt-get update \ && mkdir -p /opt \ && cd /opt \ && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \ - && dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } \ && apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y \ && rm -rf /deps