build.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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. locale-gen en_US
  14. update-locale LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8
  15. ## Prevent initramfs updates from trying to run grub and lilo.
  16. ## https://journal.paul.querna.org/articles/2013/10/15/docker-ubuntu-on-rackspace/
  17. ## http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=594189
  18. export INITRD=no
  19. echo -n no > /container/environment/INITRD
  20. echo -n C.UTF-8 > /container/environment/LANG
  21. echo -n C.UTF-8 > /container/environment/LANGUAGE
  22. echo -n C.UTF-8 > /container/environment/LC_CTYPE
  23. ## Install bash and python apt-utils.
  24. apk add --update bash python3 py-yaml
  25. rm -rf /var/cache/apk/*
  26. rm -rf /tmp/* /var/tmp/*
  27. # Remove useless files
  28. rm -rf /container/build.sh /container/Dockerfile