build.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh -ex
  2. ## Add bash tools to /sbin
  3. ln -s /container/tool/* /sbin/
  4. mkdir -p /container/service
  5. mkdir -p /container/environment /container/environment/startup
  6. chmod 700 /container/environment/ /container/environment/startup
  7. sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
  8. echo "http://mirrors.aliyun.com/alpine/edge/community" >> /etc/apk/repositories
  9. echo "Asia/Shanghai" > /etc/timezone
  10. addgroup -g 8377 docker_env
  11. # General config
  12. export LC_ALL=C
  13. ## Prevent initramfs updates from trying to run grub and lilo.
  14. ## https://journal.paul.querna.org/articles/2013/10/15/docker-ubuntu-on-rackspace/
  15. ## http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=594189
  16. export INITRD=no
  17. echo -n no > /container/environment/INITRD
  18. echo -n C.UTF-8 > /container/environment/LANG
  19. echo -n C.UTF-8 > /container/environment/LANGUAGE
  20. echo -n C.UTF-8 > /container/environment/LC_CTYPE
  21. ## Install bash and python apt-utils.
  22. apk add --update bash python3 py-yaml
  23. rm -rf /var/cache/apk/*
  24. rm -rf /tmp/* /var/tmp/*
  25. # Remove useless files
  26. rm -rf /container/build.sh /container/Dockerfile