summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Volkov <av903u@att.com>2018-10-17 22:56:12 +0000
committerAndrey Volkov <av903u@att.com>2018-10-23 14:51:03 -0700
commitd1689ae911a0a1efcb510c1972d1b894a44ed5c1 (patch)
tree25139a02ee7babb064f5e412a45c0db4106a884e
parentffa6f74f326b0a03053aee31ae00e33b2bab5a30 (diff)
Save ubuntu packages inside image
-rw-r--r--Dockerfile15
-rw-r--r--assets/packages596
-rwxr-xr-xassets/run.sh7
-rwxr-xr-xassets/startup.sh15
-rwxr-xr-xassets/update_mirror_ubuntu.sh17
5 files changed, 632 insertions, 18 deletions
diff --git a/Dockerfile b/Dockerfile
index dc358f5..c3b9ff4 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -16,7 +16,7 @@
16 16
17FROM ubuntu:xenial 17FROM ubuntu:xenial
18 18
19LABEL maintainer="urpylka@gmail.com" 19LABEL maintainer="airship-team@att.com"
20 20
21ENV DEBIAN_FRONTEND noninteractive 21ENV DEBIAN_FRONTEND noninteractive
22 22
@@ -50,8 +50,15 @@ RUN rm /etc/nginx/sites-enabled/*
50COPY assets/supervisord.nginx.conf /etc/supervisor/conf.d/nginx.conf 50COPY assets/supervisord.nginx.conf /etc/supervisor/conf.d/nginx.conf
51RUN echo "daemon off;" >> /etc/nginx/nginx.conf 51RUN echo "daemon off;" >> /etc/nginx/nginx.conf
52 52
53# Bind mount location 53ENV FULL_NAME="First Last"
54VOLUME [ "/opt/aptly" ] 54ENV EMAIL_ADDRESS="youremail@example.com"
55ENV GPG_PASSWORD="PickAPassword"
56ENV HOSTNAME=localhost
57
58COPY assets/packages /opt/packages
59
60RUN /opt/startup.sh
55 61
56# Execute Startup script when container starts 62# Execute Startup script when container starts
57ENTRYPOINT [ "/opt/startup.sh" ] 63
64CMD [ "/opt/run.sh" ]
diff --git a/assets/packages b/assets/packages
new file mode 100644
index 0000000..2662170
--- /dev/null
+++ b/assets/packages
@@ -0,0 +1,596 @@
1accountsservice
2acl
3acpid
4adduser
5amd64-microcode
6apparmor
7apport
8apport-symptoms
9apt
10apt-transport-https
11apt-utils
12arping
13at
14base-files
15base-passwd
16bash
17bash-completion
18bc
19bcache-tools
20bind9-host
21binfmt-support
22binutils
23bsdmainutils
24bsdutils
25btrfs-tools
26build-essential
27busybox-initramfs
28busybox-static
29byobu
30bzip2
31ca-certificates
32ceph-common
33cloud-guest-utils
34cloud-init
35cloud-initramfs-copymods
36cloud-initramfs-dyn-netconf
37command-not-found
38command-not-found-data
39console-setup
40console-setup-linux
41coreutils
42cpio
43cpp
44cpp-5
45crda
46cron
47cryptsetup
48cryptsetup-bin
49curl
50dash
51dbus
52debconf
53debconf-i18n
54debianutils
55dh-python
56diffutils
57distro-info-data
58dkms
59dmeventd
60dmidecode
61dmsetup
62dnsmasq-base
63dns-root-data
64dnsutils
65docker.io
66docker-engine
67dosfstools
68dpkg
69dpkg-dev
70dstat
71e2fslibs
72e2fsprogs
73eatmydata
74ed
75eject
76ethtool
77fakeroot
78file
79findutils
80fonts-ubuntu-font-family-console
81freeipmi-common
82friendly-recovery
83ftp
84fuse
85g++
86g++-5
87gawk
88gcc
89gcc-5
90gcc-5-base
91gcc-6-base
92gdisk
93geoip-database
94gettext-base
95gir1.2-glib-2.0
96git
97git-man
98gnupg
99gpgv
100grep
101groff-base
102grub2-common
103grub-common
104grub-gfxpayload-lists
105grub-legacy-ec2
106grub-pc
107grub-pc-bin
108gzip
109hdparm
110heirloom-mailx
111hostname
112ifenslave
113ifupdown
114info
115init
116initramfs-tools
117initramfs-tools-bin
118initramfs-tools-core
119initscripts
120init-system-helpers
121insserv
122installation-report
123install-info
124intel-microcode
125iotop
126iperf
127ipmitool
128iproute2
129iptables
130iputils-arping
131iputils-ping
132iputils-tracepath
133irqbalance
134isc-dhcp-client
135isc-dhcp-common
136iso-codes
137iucode-tool
138iw
139jq
140kbd
141keyboard-configuration
142klibc-utils
143kmod
144krb5-locales
145ksh
146language-selector-common
147laptop-detect
148ldap-utils
149less
150libaccountsservice0
151libacl1
152libalgorithm-diff-perl
153libalgorithm-diff-xs-perl
154libalgorithm-merge-perl
155libapparmor1
156libapparmor-perl
157libapt-inst2.0
158libapt-pkg5.0
159libasan2
160libasn1-8-heimdal
161libasprintf0v5
162libatm1
163libatomic1
164libattr1
165libaudit1
166libaudit-common
167libbabeltrace1
168libbabeltrace-ctf1
169libbind9-140
170libblas3
171libblas-common
172libblkid1
173libboost-iostreams1.58.0
174libboost-program-options1.58.0
175libboost-random1.58.0
176libboost-regex1.58.0
177libboost-system1.58.0
178libboost-thread1.58.0
179libbsd0
180libbz2-1.0
181libc6
182libc6-dev
183libcap2
184libcap2-bin
185libcap-ng0
186libc-bin
187libcc1-0
188libc-dev-bin
189libcephfs1
190libcilkrts5
191libcomerr2
192libcryptsetup4
193libcurl3-gnutls
194libdb5.3
195libdbus-1-3
196libdbus-glib-1-2
197libdebconfclient0
198libdevmapper1.02.1
199libdevmapper-event1.02.1
200libdns162
201libdns-export162
202libdpkg-perl
203libdrm2
204libdrm-common
205libdumbnet1
206libdw1
207libeatmydata1
208libedit2
209libelf1
210liberror-perl
211libestr0
212libevent-2.0-5
213libexpat1
214libfakeroot
215libfcgi0ldbl
216libfdisk1
217libffi6
218libfile-fcntllock-perl
219libfreeipmi16
220libfreetype6
221libfribidi0
222libfuse2
223libgcc1
224libgcc-5-dev
225libgcrypt20
226libgdbm3
227libgeoip1
228libgirepository-1.0-1
229libglib2.0-0
230libglib2.0-data
231libgmp10
232libgnutls30
233libgnutls-openssl27
234libgomp1
235libgpg-error0
236libgpm2
237libgssapi3-heimdal
238libgssapi-krb5-2
239libhcrypto4-heimdal
240libheimbase1-heimdal
241libheimntlm0-heimdal
242libhogweed4
243libhx509-5-heimdal
244libicu55
245libidn11
246libisc160
247libisccc140
248libisccfg140
249libisc-export160
250libisl15
251libitm1
252libjansson4
253libjson-c2
254libk5crypto3
255libkeyutils1
256libklibc
257libkmod2
258libkrb5-26-heimdal
259libkrb5-3
260libkrb5support0
261libldap-2.4-2
262liblinear3
263liblocale-gettext-perl
264liblsan0
265libltdl7
266liblua5.2-0
267liblvm2app2.2
268liblvm2cmd2.02
269liblwres141
270liblxc1
271liblz4-1
272liblzma5
273liblzo2-2
274libmagic1
275libmnl0
276libmount1
277libmpc3
278libmpdec2
279libmpfr4
280libmpx0
281libmspack0
282libncurses5
283libncursesw5
284libnet1
285libnetfilter-conntrack3
286libnettle6
287libnewt0.52
288libnfnetlink0
289libnih1
290libnl-3-200
291libnl-genl-3-200
292libnspr4
293libnss3
294libnss3-nssdb
295libnuma1
296libonig2
297libopenipmi0
298libopts25
299libp11-kit0
300libpam0g
301libpam-modules
302libpam-modules-bin
303libpam-runtime
304libpam-systemd
305libparted2
306libpcap0.8
307libpci3
308libpcre3
309libperl5.22
310libpipeline1
311libplymouth4
312libpng12-0
313libpolkit-agent-1-0
314libpolkit-backend-1-0
315libpolkit-gobject-1-0
316libpopt0
317libprocps4
318libprotobuf9v5
319libpython2.7-minimal
320libpython2.7-stdlib
321libpython3.5
322libpython3.5-minimal
323libpython3.5-stdlib
324libpython3-stdlib
325libpython-stdlib
326libquadmath0
327librados2
328libradosstriper1
329librbd1
330libreadline5
331libreadline6
332librgw2
333libroken18-heimdal
334librtmp1
335libsasl2-2
336libsasl2-modules
337libsasl2-modules-db
338libseccomp2
339libselinux1
340libsemanage1
341libsemanage-common
342libsensors4
343libsepol1
344libsigsegv2
345libslang2
346libsmartcols1
347libsnmp30
348libsnmp-base
349libsqlite3-0
350libss2
351libssl1.0.0
352libstdc++-5-dev
353libstdc++6
354libsystemd0
355libtasn1-6
356libtext-charwidth-perl
357libtext-iconv-perl
358libtext-wrapi18n-perl
359libtinfo5
360libtsan0
361libubsan0
362libudev1
363libunwind8
364libusb-0.1-4
365libusb-1.0-0
366libustr-1.0-1
367libutempter0
368libuuid1
369libuv1
370libwind0-heimdal
371libwrap0
372libx11-6
373libx11-data
374libxau6
375libxcb1
376libxdmcp6
377libxext6
378libxml2
379libxmlsec1
380libxmlsec1-openssl
381libxmuu1
382libxslt1.1
383libxtables11
384libyaml-0-2
385linux-base
386linux-cloud-tools-common
387linux-firmware
388linux-generic-hwe-16.04
389linux-headers-4.15.0-34
390linux-headers-4.15.0-34-generic
391linux-headers-generic-hwe-16.04
392linux-image-4.15.0-34-generic
393linux-image-extra-4.13.0-45-generic
394linux-image-generic-hwe-16.04
395linux-libc-dev
396linux-modules-4.15.0-34-generic
397linux-modules-extra-4.15.0-34-generic
398linux-signed-generic-hwe-16.04
399linux-signed-image-4.13.0-45-generic
400linux-tools-common
401lldpd
402locales
403login
404logrotate
405lsb-base
406lsb-release
407lshw
408lsof
409ltrace
410lua-lpeg
411lvm2
412lxc-common
413lxcfs
414lxd
415lxd-client
416make
417makedev
418man-db
419manpages
420manpages-dev
421mawk
422mdadm
423mime-support
424mlocate
425mosh
426mount
427mtr-tiny
428multiarch-support
429nano
430ncurses-base
431ncurses-bin
432ncurses-term
433ndiff
434netbase
435netcat-openbsd
436net-tools
437nmap
438node-commander
439nodejs
440node-nan
441node-tinycolor
442node-ws
443ntfs-3g
444ntp
445openipmi
446open-iscsi
447openssh-client
448openssh-server
449openssh-sftp-server
450openssl
451open-vm-tools
452os-prober
453overlayroot
454parted
455passwd
456pastebinit
457patch
458pciutils
459perl
460perl-base
461perl-modules-5.22
462plymouth
463plymouth-theme-ubuntu-text
464policykit-1
465pollinate
466popularity-contest
467powermgmt-base
468procps
469psmisc
470python
471python2.7
472python2.7-minimal
473python3
474python3.5
475python3.5-minimal
476python3-apport
477python3-apt
478python3-blinker
479python3-cffi-backend
480python3-chardet
481python3-commandnotfound
482python3-configobj
483python3-cryptography
484python3-dbus
485python3-debian
486python3-distupgrade
487python3-gdbm
488python3-gi
489python3-idna
490python3-jinja2
491python3-jsonpatch
492python3-json-pointer
493python3-jwt
494python3-markupsafe
495python3-minimal
496python3-newt
497python3-oauthlib
498python3-pkg-resources
499python3-prettytable
500python3-problem-report
501python3-pyasn1
502python3-pycurl
503python3-requests
504python3-serial
505python3-six
506python3-software-properties
507python3-systemd
508python3-update-manager
509python3-urllib3
510python3-yaml
511python-apt
512python-apt-common
513python-bs4
514python-cephfs
515python-chardet
516python-html5lib
517python-lxml
518python-minimal
519python-pkg-resources
520python-rados
521python-rbd
522python-requests
523python-six
524python-urllib3
525readline-common
526rename
527resolvconf
528rsync
529rsyslog
530run-one
531sbsigntool
532screen
533sed
534sensible-utils
535sgml-base
536shared-mime-info
537s-nail
538snapd
539socat
540software-properties-common
541sosreport
542squashfs-tools
543ssh-import-id
544ssmtp
545strace
546sudo
547sysstat
548systemd
549systemd-sysv
550sysvinit-utils
551sysv-rc
552tar
553tasksel
554tasksel-data
555tcpd
556tcpdump
557telnet
558thermald
559time
560tmux
561traceroute
562tzdata
563ubuntu-cloudimage-keyring
564ubuntu-core-launcher
565ubuntu-keyring
566ubuntu-minimal
567ubuntu-release-upgrader-core
568ubuntu-standard
569ucf
570udev
571ufw
572uidmap
573unattended-upgrades
574unzip
575update-manager-core
576update-notifier-common
577ureadahead
578usbutils
579util-linux
580uuid-runtime
581vim
582vim-common
583vim-runtime
584vim-tiny
585vlan
586wget
587whiptail
588wireless-regdb
589xauth
590xdg-user-dirs
591xfsprogs
592xkb-data
593xml-core
594xz-utils
595zerofree
596zlib1g
diff --git a/assets/run.sh b/assets/run.sh
new file mode 100755
index 0000000..e87c374
--- /dev/null
+++ b/assets/run.sh
@@ -0,0 +1,7 @@
1#!/usr/bin/env bash
2
3set -o pipefail
4set -o errexit
5# set -o xtrace
6
7/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
diff --git a/assets/startup.sh b/assets/startup.sh
index 0ab55b6..8752c0e 100755
--- a/assets/startup.sh
+++ b/assets/startup.sh
@@ -5,6 +5,8 @@
5# Copyright 2016 Bryan J. Hong 5# Copyright 2016 Bryan J. Hong
6# Licensed under the Apache License, Version 2.0 6# Licensed under the Apache License, Version 2.0
7 7
8set -o xtrace
9
8if [[ ! -f /root/.gnupg/gpg.conf ]]; then 10if [[ ! -f /root/.gnupg/gpg.conf ]]; then
9 /opt/gpg.conf.sh 11 /opt/gpg.conf.sh
10fi 12fi
@@ -14,19 +16,15 @@ if [[ ! -f /opt/aptly/aptly.sec ]] || [[ ! -f /opt/aptly/aptly.pub ]]; then
14 echo "Generating new gpg keys" 16 echo "Generating new gpg keys"
15 cp -a /dev/urandom /dev/random 17 cp -a /dev/urandom /dev/random
16 /opt/gpg_batch.sh 18 /opt/gpg_batch.sh
19 mkdir -p /opt/aptly
17 # If your system doesn't have a lot of entropy this may, take a long time 20 # If your system doesn't have a lot of entropy this may, take a long time
18 # Google how-to create "artificial" entropy if this gets stuck 21 # Google how-to create "artificial" entropy if this gets stuck
19 gpg --batch --gen-key /opt/gpg_batch 22 gpg -v --batch --gen-key /opt/gpg_batch
23
20else 24else
21 echo "No need to generate new gpg keys" 25 echo "No need to generate new gpg keys"
22fi 26fi
23 27
24# Export the GPG Public key
25if [[ ! -f /opt/aptly/public/aptly_repo_signing.key ]]; then
26 mkdir -p /opt/aptly/public
27 gpg --export --armor > /opt/aptly/public/aptly_repo_signing.key
28fi
29
30# Import Ubuntu keyrings if they exist 28# Import Ubuntu keyrings if they exist
31if [[ -f /usr/share/keyrings/ubuntu-archive-keyring.gpg ]]; then 29if [[ -f /usr/share/keyrings/ubuntu-archive-keyring.gpg ]]; then
32 gpg --list-keys 30 gpg --list-keys
@@ -56,5 +54,4 @@ ln -sf /opt/aptly/aptly.pub /root/.gnupg/pubring.gpg
56# Generate Nginx Config 54# Generate Nginx Config
57/opt/nginx.conf.sh 55/opt/nginx.conf.sh
58 56
59# Start Supervisor 57/opt/update_mirror_ubuntu.sh
60/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
diff --git a/assets/update_mirror_ubuntu.sh b/assets/update_mirror_ubuntu.sh
index c2f49e2..2a6e70e 100755
--- a/assets/update_mirror_ubuntu.sh
+++ b/assets/update_mirror_ubuntu.sh
@@ -1,19 +1,26 @@
1#! /usr/bin/env bash 1#! /usr/bin/env bash
2set -e 2set -e
3set -x
3 4
4# Automate the initial creation and update of an Ubuntu package mirror in aptly 5# Automate the initial creation and update of an Ubuntu package mirror in aptly
5 6
6# The variables (as set below) will create a mirror of the Ubuntu Trusty repo 7# The variables (as set below) will create a mirror of the Ubuntu repo
7# with the main & universe components, you can add other components like restricted 8# with the main & universe components, you can add other components like restricted
8# multiverse etc by adding to the array (separated by spaces). 9# multiverse etc by adding to the array (separated by spaces).
9 10
10# For more detail about each of the variables below refer to: 11# For more detail about each of the variables below refer to:
11# https://help.ubuntu.com/community/Repositories/CommandLine 12# https://help.ubuntu.com/community/Repositories/CommandLine
12 13
13UBUNTU_RELEASE=bionic 14UBUNTU_RELEASE=xenial
14UPSTREAM_URL="http://archive.ubuntu.com/ubuntu/" 15UPSTREAM_URL="http://archive.ubuntu.com/ubuntu/"
15COMPONENTS=( main universe ) 16COMPONENTS=( main universe )
16REPOS=( ${UBUNTU_RELEASE} ${UBUNTU_RELEASE}-updates ${UBUNTU_RELEASE}-security ) 17REPOS=( ${UBUNTU_RELEASE} ${UBUNTU_RELEASE}-updates ${UBUNTU_RELEASE}-security )
18MODE='packages' # packages - mirror specified packages or all
19if [ "$MODE" = "packages" ]; then
20 FILTER_OPTS=(-filter="$(cat /opt/packages | paste -sd \| -)" -filter-with-deps)
21else
22 FILTER_OPTS=()
23fi
17 24
18# Create repository mirrors if they don't exist 25# Create repository mirrors if they don't exist
19set +e 26set +e
@@ -23,7 +30,7 @@ for component in ${COMPONENTS[@]}; do
23 if [[ $? -ne 0 ]]; then 30 if [[ $? -ne 0 ]]; then
24 echo "Creating mirror of ${repo}-${component} repository." 31 echo "Creating mirror of ${repo}-${component} repository."
25 aptly mirror create \ 32 aptly mirror create \
26 -architectures=amd64 ${repo}-${component} ${UPSTREAM_URL} ${repo} ${component} 33 -architectures=amd64 "${FILTER_OPTS[@]}" ${repo}-${component} ${UPSTREAM_URL} ${repo} ${component}
27 fi 34 fi
28 done 35 done
29done 36done
@@ -49,7 +56,7 @@ done
49echo ${SNAPSHOTARRAY[@]} 56echo ${SNAPSHOTARRAY[@]}
50 57
51# Merge snapshots into a single snapshot with updates applied 58# Merge snapshots into a single snapshot with updates applied
52echo "Merging snapshots into one.." 59echo "Merging snapshots into one.."
53aptly snapshot merge -latest \ 60aptly snapshot merge -latest \
54 ${UBUNTU_RELEASE}-merged-`date +%Y%m%d%H` \ 61 ${UBUNTU_RELEASE}-merged-`date +%Y%m%d%H` \
55 ${SNAPSHOTARRAY[@]} 62 ${SNAPSHOTARRAY[@]}