Install ubuntu docker full version
Troubled for a long time how to install the full version of ubuntu docker, and later found from the ssh log into docker mirror when prompted, you can use a single command to install the full version of ubuntu perfect.
command
unminimize
Implementation of the results
➜ ~ unminimize
This system has been minimized by removing packages and content that are
not required on a system that users do not log into.
This script restores content and packages that are found on a default
Ubuntu server system in order to make this system more suitable for
interactive use.
Reinstallation of packages may fail due to changes to the system
configuration, the presence of third-party packages, or for other
reasons.
This operation may take some time.
Would you like to continue?
We're done!
Script content
Not every ubuntu version has found this script, so the script posted out.
Script is located /usr/local/sbin/unminimize
.
Details are as follows:
#!/bin/sh
set -e
echo "This system has been minimized by removing packages and content that are"
echo "not required on a system that users do not log into."
echo ""
echo "This script restores content and packages that are found on a default"
echo "Ubuntu server system in order to make this system more suitable for"
echo "interactive use."
echo ""
echo "Reinstallation of packages may fail due to changes to the system"
echo "configuration, the presence of third-party packages, or for other"
echo "reasons."
echo ""
echo "This operation may take some time."
echo ""
read -p "Would you like to continue? [y/N]" REPLY
echo # (optional) move to a new line
if [ "$REPLY" != "y" ] && [ "$REPLY" != "Y" ]
then
exit 1
fi
if [ -f /etc/dpkg/dpkg.cfg.d/excludes ] || [ -f /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp ]; then
echo "Re-enabling installation of all documentation in dpkg..."
if [ -f /etc/dpkg/dpkg.cfg.d/excludes ]; then
mv /etc/dpkg/dpkg.cfg.d/excludes /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp
fi
echo "Updating package list and upgrading packages..."
apt-get update
# apt-get upgrade asks for confirmation before upgrading packages to let the user stop here
apt-get upgrade
echo "Restoring system documentation..."
echo "Reinstalling packages with files in /usr/share/man/ ..."
# Reinstallation takes place in two steps because a single dpkg --verified
# command generates very long parameter list for "xargs dpkg -S" and may go
# over ARG_MAX. Since many packages have man pages the second download
# handles a much smaller amount of packages.
dpkg -S /usr/share/man/ |sed 's|, |\n|g;s|: [^:]*$||' | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y
echo "Reinstalling packages with system documentation in /usr/share/doc/ .."
# This step processes the packages which still have missing documentation
dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {print $2}' | sed 's|/[^/]*$||' | sort |uniq \
| xargs dpkg -S | sed 's|, |\n|g;s|: [^:]*$||' | uniq | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y
if dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {exit 1}'; then
echo "Documentation has been restored successfully."
rm /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp
else
echo "There are still files missing from /usr/share/doc/:"
dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {print " " $2}'
echo "You may want to try running this script again or you can remove"
echo "/etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp and restore the files manually."
fi
fi
if ! dpkg-query --show --showformat='${db:Status-Status}\n' ubuntu-minimal 2> /dev/null | grep -q '^installed$'; then
echo "Installing ubuntu-minimal package to provide the familiar Ubuntu minimal system..."
DEBIAN_FRONTEND=noninteractive apt-get install -y ubuntu-minimal ubuntu-standard
fi
if dpkg-query --show --showformat='${db:Status-Status}\n' ubuntu-server 2> /dev/null | grep -q '^installed$' \
&& ! dpkg-query --show --showformat='${db:Status-Status}\n' landscape-common 2> /dev/null | grep -q '^installed$'; then
echo "Installing ubuntu-server recommends..."
DEBIAN_FRONTEND=noninteractive apt-get install -y landscape-common
fi
# unminimization succeeded, there is no need to mention it in motd
rm -f /etc/update-motd.d/60-unminimize
Production ubuntu mirror full version Docker
Once you know the above command, making Docker mirror is very easy.
Save the following fileDockerfile
FROM ubuntu:18.04
RUN export DEBIAN_FRONTEND=noninteractive && \
bash -c 'yes | unminimize'
Operation is then performed to compile the image docker
docker build . -t ubuntu:18.04-full
You can easily perform a complete version of the mirror
docker run -it --rm ubuntu:18.04 bash
Compared
The method described in this blog relatively relatively cumbersome.
Production ubuntu full version docker mirror (cradle08)
- Welcome to comment and email to exchange ideas and authors.
- Copyright : This article is m2kar the original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
- Author : m2kar
- A reward Links : Welcome to a reward m2kar, your reward is playing an important source of my creation
- E-mail : m2kar.cn # gmail.com
- Home : m2kar.cn
- Github: github.com/m2kar
- CSDN : M2kar column