mirror of
https://github.com/ggogel/seafile-containerized.git
synced 2024-11-16 09:01:38 +00:00
Use docke-squash to make a smaller base image.
This commit is contained in:
parent
acf1a5e77a
commit
49e15df129
|
@ -1,6 +1,7 @@
|
|||
server_version=6.0.5
|
||||
|
||||
base_image=seafileorg/base:16.04
|
||||
base_image_squashed=seafileorg/base:16.04-squashed
|
||||
server_image=seafileorg/server:$(server_version)
|
||||
|
||||
all:
|
||||
|
@ -14,6 +15,10 @@ base:
|
|||
server:
|
||||
cd seafile && docker build -t $(server_image) .
|
||||
|
||||
squash-base:
|
||||
docker-squash --verbose --tag $(base_image_squashed) $(base_image)
|
||||
docker tag $(base_image_squashed) $(base_image)
|
||||
|
||||
push:
|
||||
docker push $(base_image)
|
||||
docker push $(server_image)
|
||||
|
|
|
@ -38,7 +38,21 @@ RUN mkdir -p /etc/service/mysql && \
|
|||
RUN mkdir -p /etc/my_init.d && rm -f /etc/my_init.d/00_regen_ssh_host_keys.sh
|
||||
ADD my_init.d/99_mysql_setup.sh /etc/my_init.d/
|
||||
|
||||
# clean up for docker squash
|
||||
RUN rm -rf \
|
||||
/root/.cache \
|
||||
/root/.npm \
|
||||
/root/.pip \
|
||||
/usr/local/share/doc \
|
||||
/usr/share/doc \
|
||||
/usr/share/man \
|
||||
/usr/share/vim/vim74/doc \
|
||||
/usr/share/vim/vim74/lang \
|
||||
/usr/share/vim/vim74/spell/en*
|
||||
/usr/share/vim/vim74/tutor \
|
||||
/var/lib/apt/lists/* \
|
||||
/tmp/* \
|
||||
|
||||
CMD ["/sbin/my_init", "--", "bash", "-l"]
|
||||
|
||||
# TODO: clean up & squash layers with docker-squash
|
||||
# See https://github.com/jwilder/docker-squash
|
||||
# Docker squash
|
||||
|
|
Loading…
Reference in a new issue