Skip to content
Snippets Groups Projects
Unverified Commit 3e9dcc58 authored by Angel Misevski's avatar Angel Misevski Committed by GitHub
Browse files

Install standard tooling in workspace dev containers (#271)


* Provide a method for installing standard tooling in patched images

To support providing standard tooling across all images used in
devfiles, this commit attempts to add a distro-agnostic script for
installing common packages into development images.

Currently, common commandline editors vim and nano are installed.

Signed-off-by: default avatarAngel Misevski <amisevsk@redhat.com>

* Print list of images patched with arbitrary UID support

Print a list of the images that were created upon completion of the
build_images.sh script, to aid testing.

Signed-off-by: default avatarAngel Misevski <amisevsk@redhat.com>

* Rename tooling install script for arb uid patched images

Rename 'install-tooling.sh' to 'install-editor-tooling.sh' to better
represent its purpose.

Signed-off-by: default avatarAngel Misevski <amisevsk@redhat.com>
parent 47f79868
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,10 @@ USER 0
COPY --chown=0:0 entrypoint.sh /
RUN mkdir -p /home/user && chgrp -R 0 /home && chmod -R g=u /etc/passwd /etc/group /home && chmod +x /entrypoint.sh
# Install common terminal editors in container to aid development process
COPY install-editor-tooling.sh /tmp
RUN /tmp/install-editor-tooling.sh && rm -f /tmp/install-editor-tooling.sh
USER 10001
ENV HOME=/home/user
WORKDIR /projects
......
......@@ -27,6 +27,7 @@ if [ "$1" == "--push" ]; then
PUSH_IMAGES=true
fi
BUILT_IMAGES=""
while read -r line; do
base_image_name=$(echo "$line" | tr -s ' ' | cut -f 1 -d ' ')
base_image=$(echo "$line" | tr -s ' ' | cut -f 2 -d ' ')
......@@ -36,4 +37,8 @@ while read -r line; do
echo "Pushing ${NAME_FORMAT}/${base_image_name}:${TAG}" to remote registry
docker push "${NAME_FORMAT}/${base_image_name}:${TAG}" | cat
fi
BUILT_IMAGES="${BUILT_IMAGES} ${NAME_FORMAT}/${base_image_name}:${TAG}\n"
done < "${SCRIPT_DIR}"/base_images
echo "Built images:"
echo -e "$BUILT_IMAGES"
#!/bin/bash
#
# Copyright (c) 2019-2020 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Ensure $HOME exists when starting
if [ ! -d "${HOME}" ]; then
......
#!/bin/bash
#
# Copyright (c) 2020 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
set -e
TOOLING=(vim nano)
if command -v dnf 2> /dev/null; then
dnf install -y "${TOOLING[@]}"
dnf -y clean all
elif command -v yum 2> /dev/null; then
yum install -y "${TOOLING[@]}"
yum -y clean all
elif command -v apt-get 2> /dev/null; then
apt-get update
apt-get install -y "${TOOLING[@]}"
apt-get clean
rm -rf /var/lib/apt/lists/*
elif command -v apk 2> /dev/null; then
apk add --no-cache "${TOOLING[@]}"
fi
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment