summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Volkov <av903u@att.com>2018-10-24 07:10:04 -0700
committerAndrey Volkov <av903u@att.com>2018-10-24 07:26:15 -0700
commitb573730642198a31e62274b177029a059d099b86 (patch)
tree13d3ab2996714f53e58e6e2d9e311c339e41b4d9
parent1cf350e59785ec77a3265bae42b748ff6c6cb3ad (diff)
Link to package file as a build arg
-rw-r--r--Dockerfile4
-rw-r--r--Vagrantfile12
-rw-r--r--assets/packages/default (renamed from assets/packages)0
-rwxr-xr-xassets/update_mirror_ubuntu.sh6
4 files changed, 14 insertions, 8 deletions
diff --git a/Dockerfile b/Dockerfile
index a7d160d..ec8fbf8 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -55,6 +55,7 @@ ARG EMAIL_ADDRESS="youremail@example.com"
55ARG GPG_PASSWORD="PickAPassword" 55ARG GPG_PASSWORD="PickAPassword"
56ARG HOSTNAME=localhost 56ARG HOSTNAME=localhost
57ARG MODE=packages 57ARG MODE=packages
58ARG PACKAGE_FILE=default
58ARG UBUNTU_RELEASE=xenial 59ARG UBUNTU_RELEASE=xenial
59ARG UPSTREAM_URL="http://archive.ubuntu.com/ubuntu/" 60ARG UPSTREAM_URL="http://archive.ubuntu.com/ubuntu/"
60ARG COMPONENTS="main universe" 61ARG COMPONENTS="main universe"
@@ -65,12 +66,13 @@ ENV EMAIL_ADDRESS ${EMAIL_ADDRESS}
65ENV GPG_PASSWORD ${GPG_PASSWORD} 66ENV GPG_PASSWORD ${GPG_PASSWORD}
66ENV HOSTNAME ${HOSTNAME} 67ENV HOSTNAME ${HOSTNAME}
67ENV MODE ${MODE} 68ENV MODE ${MODE}
69ENV PACKAGE_FILE=${PACKAGE_FILE}
68ENV UBUNTU_RELEASE=${UBUNTU_RELEASE} 70ENV UBUNTU_RELEASE=${UBUNTU_RELEASE}
69ENV UPSTREAM_URL=${UPSTREAM_URL} 71ENV UPSTREAM_URL=${UPSTREAM_URL}
70ENV COMPONENTS=${COMPONENTS} 72ENV COMPONENTS=${COMPONENTS}
71ENV REPOS=${REPOS} 73ENV REPOS=${REPOS}
72 74
73COPY assets/packages /opt/packages 75COPY assets/packages/* /opt/packages/
74COPY assets/gpg/* /opt/aptly/ 76COPY assets/gpg/* /opt/aptly/
75 77
76RUN /opt/startup.sh 78RUN /opt/startup.sh
diff --git a/Vagrantfile b/Vagrantfile
index 1eee671..bc05447 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -82,15 +82,15 @@ Vagrant.configure("2") do |config|
82 node.vm.provision "file", source: ".", destination: "$HOME/docker-aptly" 82 node.vm.provision "file", source: ".", destination: "$HOME/docker-aptly"
83 83
84 node.vm.provision :shell, inline: <<-SHELL 84 node.vm.provision :shell, inline: <<-SHELL
85 echo htop > /home/vagrant/docker-aptly/assets/packages 85 echo htop > /home/vagrant/docker-aptly/assets/packages/list
86 echo telnetd >> /home/vagrant/docker-aptly/assets/packages 86 echo telnetd >> /home/vagrant/docker-aptly/assets/packages/list
87 echo openbsd-inetd >> /home/vagrant/docker-aptly/assets/packages 87 echo openbsd-inetd >> /home/vagrant/docker-aptly/assets/packages/list
88 echo inet-superserver >> /home/vagrant/docker-aptly/assets/packages 88 echo inet-superserver >> /home/vagrant/docker-aptly/assets/packages/list
89 echo 'mysql-client (>= 3.6)' >> /home/vagrant/docker-aptly/assets/packages 89 echo 'mysql-client (>= 3.6)' >> /home/vagrant/docker-aptly/assets/packages/list
90 SHELL 90 SHELL
91 91
92 node.vm.provision "docker" do |d| 92 node.vm.provision "docker" do |d|
93 d.build_image "/home/vagrant/docker-aptly -t aptly:test" 93 d.build_image "/home/vagrant/docker-aptly -t aptly:test --build-arg PACKAGE_FILE=list"
94 d.run "aptly", 94 d.run "aptly",
95 args: "-p '8080:80' -v '/home/vagrant/docker-aptly/assets/nginx:/opt/nginx'", 95 args: "-p '8080:80' -v '/home/vagrant/docker-aptly/assets/nginx:/opt/nginx'",
96 image: "aptly:test" 96 image: "aptly:test"
diff --git a/assets/packages b/assets/packages/default
index 2662170..2662170 100644
--- a/assets/packages
+++ b/assets/packages/default
diff --git a/assets/update_mirror_ubuntu.sh b/assets/update_mirror_ubuntu.sh
index 336eb00..35787db 100755
--- a/assets/update_mirror_ubuntu.sh
+++ b/assets/update_mirror_ubuntu.sh
@@ -12,7 +12,11 @@ set -x
12# https://help.ubuntu.com/community/Repositories/CommandLine 12# https://help.ubuntu.com/community/Repositories/CommandLine
13 13
14if [ "$MODE" = "packages" ]; then 14if [ "$MODE" = "packages" ]; then
15 FILTER_OPTS=(-filter="$(cat /opt/packages | paste -sd \| -)" -filter-with-deps) 15 if [ ! -f "/opt/packages/$PACKAGE_FILE" ]; then
16 echo "File with a package list is not found"
17 exit 1
18 fi
19 FILTER_OPTS=(-filter="$(cat /opt/packages/$PACKAGE_FILE | paste -sd \| -)" -filter-with-deps)
16else 20else
17 FILTER_OPTS=() 21 FILTER_OPTS=()
18fi 22fi