diff --git a/Dockerfile b/Dockerfile index b2c577d..eb9a5c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,17 +12,14 @@ # # -# Template begins here (from templates/templates/00-FROM.in) +# Template from templates/templates/00-FROM.in # -# Creates a base OSGC Intel enabled Ubuntu image -# -# Derivatives include -dev variation which adds git, build-essentials, -# source repos, etc. -# -FROM amr-registry.caas.intel.com/vtt-osgc/os/osgc-ubuntu:disco +# Pull from the internal cache of images +FROM amr-registry.caas.intel.com/vtt-osgc/os/ubuntu:disco + # -# Template begins here (from templates/templates/05-intel-proxy.in) +# Template from templates/templates/05-intel-proxy.in # # Pre-install proxy configuration values # @@ -35,7 +32,27 @@ RUN echo "Acquire::http::proxy \"http://proxy-chain.intel.com:911/\";\n" \ "Acquire::http::Proxy::osgc.jf.intel.com DIRECT;\n" > /etc/apt/apt.conf # -# Template begins here (from templates/templates/10-default-packages.in) +# Template from templates/templates/08-intel-certs.in +# +# Install Intel CA5A cert so Intel certs are recognized + +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ + ca-certificates \ + wget \ + unzip \ + && mkdir -p /usr/local/share/ca-certificates \ + && wget -qO tmp.zip http://certificates.intel.com/repository/certificates/IntelSHA2RootChain-Base64.zip \ + && unzip tmp.zip -d /usr/local/share/ca-certificates \ + && rm tmp.zip \ + && wget -qO tmp.zip http://certificates.intel.com/repository/certificates/Intel%20Root%20Certificate%20Chain%20Base64.zip \ + && unzip tmp.zip -d /usr/local/share/ca-certificates \ + && rm tmp.zip \ + && update-ca-certificates --fresh + + +# +# Template from templates/templates/10-default-packages.in # # Update the repo lists and then install things using the internal # sources. Packages used by many developers are pulled into this image @@ -58,7 +75,7 @@ RUN localedef -c -f UTF-8 -i en_US en_US.UTF-8 ENV LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8 # -# Template begins here (from templates/templates/20-create-agama-user.in) +# Template from templates/templates/20-create-agama-user.in # # Create user 'agama' and add them to 'sudo' for sudo access and set # the passwd to 'agama' @@ -76,7 +93,7 @@ RUN groupadd -r agama \ RUN sed -i -e 's,%sudo.*,%sudo ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers # -# Template begins here (from templates/templates/25-install-agama.in) +# Template from templates/templates/25-install-agama.in # # Update and install gpg-agent as it isn't in the base Ubuntu image and is needed for apt-key RUN apt-get -q update \ diff --git a/scripts/build-dockerfile b/scripts/build-dockerfile index 3d6cb04..5b3ee46 100755 --- a/scripts/build-dockerfile +++ b/scripts/build-dockerfile @@ -29,7 +29,7 @@ for snippet in templates/??-*.in; do cat << EOM >> Dockerfile # -# Template $snippt begins here (from templates/${snippet}) +# Template from templates/${snippet} # EOM envsubst < $snippet >> Dockerfile diff --git a/scripts/build-images b/scripts/build-images index 2e6d513..09aa43a 100755 --- a/scripts/build-images +++ b/scripts/build-images @@ -5,7 +5,15 @@ export $(grep -v '^#' SOLUTION | xargs -d '\n') export $(grep -v '^#' MANIFEST | xargs -d '\n') -docker build . -t ${CONTAINER}:agama-${AGAMA_VERSION} +docker build . -t ${CONTAINER}:agama-${AGAMA_VERSION} || { +cat << EOM + +Building docker image failed. + +EOM + exit $? +} + docker tag ${CONTAINER}:agama-${AGAMA_VERSION} ${CONTAINER} cat << EOM diff --git a/templates/00-FROM.in b/templates/00-FROM.in index d1de90b..1fd5763 100644 --- a/templates/00-FROM.in +++ b/templates/00-FROM.in @@ -1,6 +1,3 @@ -# Creates a base OSGC Intel enabled Ubuntu image -# -# Derivatives include -dev variation which adds git, build-essentials, -# source repos, etc. -# -FROM amr-registry.caas.intel.com/vtt-osgc/os/osgc-$OS_DISTRO:$OS_RELEASE +# Pull from the internal cache of images +FROM amr-registry.caas.intel.com/vtt-osgc/os/$OS_DISTRO:$OS_RELEASE + diff --git a/templates/08-intel-certs.in b/templates/08-intel-certs.in new file mode 100644 index 0000000..edf6df8 --- /dev/null +++ b/templates/08-intel-certs.in @@ -0,0 +1,16 @@ +# Install Intel CA5A cert so Intel certs are recognized + +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ + ca-certificates \ + wget \ + unzip \ + && mkdir -p /usr/local/share/ca-certificates \ + && wget -qO tmp.zip http://certificates.intel.com/repository/certificates/IntelSHA2RootChain-Base64.zip \ + && unzip tmp.zip -d /usr/local/share/ca-certificates \ + && rm tmp.zip \ + && wget -qO tmp.zip http://certificates.intel.com/repository/certificates/Intel%20Root%20Certificate%20Chain%20Base64.zip \ + && unzip tmp.zip -d /usr/local/share/ca-certificates \ + && rm tmp.zip \ + && update-ca-certificates --fresh +