Skip to content

Commit

Permalink
Extract Picons on boot Release-4.2 (#128)
Browse files Browse the repository at this point in the history
* reworking logic to untar on first boot and reducing sample size for chown logic as it is not recursive

* bad path in arm variants
  • Loading branch information
thelamer authored and tobbenb committed Mar 28, 2019
1 parent 6eb2939 commit e7ffd7f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 27 deletions.
10 changes: 2 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,8 @@ RUN \
echo "**** Add Picons ****" && \
mkdir -p /picons && \
curl -o \
/tmp/picons.tar.bz2 -L \
https://lsio-ci.ams3.digitaloceanspaces.com/picons/picons.tar.bz2 && \
tar xf \
/tmp/picons.tar.bz2 -C \
/picons && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/*
/picons.tar.bz2 -L \
https://lsio-ci.ams3.digitaloceanspaces.com/picons/picons.tar.bz2

# copy local files and buildstage artifacts
COPY --from=buildstage /tmp/argtable-build/usr/ /usr/
Expand Down
10 changes: 2 additions & 8 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,8 @@ RUN \
echo "**** Add Picons ****" && \
mkdir -p /picons && \
curl -o \
/tmp/picons.tar.bz2 -L \
https://lsio-ci.ams3.digitaloceanspaces.com/picons/picons.tar.bz2 && \
tar xf \
/tmp/picons.tar.bz2 -C \
/picons && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/*
/picons.tar.bz2 -L \
https://lsio-ci.ams3.digitaloceanspaces.com/picons/picons.tar.bz2

# copy local files and buildstage artifacts
COPY --from=buildstage /tmp/argtable-build/usr/ /usr/
Expand Down
10 changes: 2 additions & 8 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,8 @@ RUN \
echo "**** Add Picons ****" && \
mkdir -p /picons && \
curl -o \
/tmp/picons.tar.bz2 -L \
https://lsio-ci.ams3.digitaloceanspaces.com/picons/picons.tar.bz2 && \
tar xf \
/tmp/picons.tar.bz2 -C \
/picons && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/*
/picons.tar.bz2 -L \
https://lsio-ci.ams3.digitaloceanspaces.com/picons/picons.tar.bz2

# copy local files and buildstage artifacts
COPY --from=buildstage /tmp/argtable-build/usr/ /usr/
Expand Down
11 changes: 8 additions & 3 deletions root/etc/cont-init.d/30-config
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@ mkdir -p \
[[ ! -e /config/config ]] && \
(cp /defaults/config /config/config)

# extract picons on first run
[[ -f /picons.tar.bz2 ]] && \
tar xf \
/picons.tar.bz2 -C \
/picons &&
rm -f /picons.tar.bz2


# function to randomly sample 10 files for their owner and only chown if not abc
# function to randomly sample 5 files for their owner and only chown if not abc
chowner () {
files=(${1}/*)
for i in {1..10}; do
for i in {1..5}; do
user=$(stat -c '%U' $(printf "%s\n" "${files[RANDOM % ${#files[@]}]}"))
if [ "${user}" != "abc" ]; then
chown -R abc:abc ${1}
Expand Down

0 comments on commit e7ffd7f

Please sign in to comment.