项目作者: tekintian

项目描述 :
更换了国内源,和安装了openrc 管理工具的 Alpine Docker 镜像
高级语言: Dockerfile
项目地址: git://github.com/tekintian/alpine.git
创建时间: 2018-12-03T15:00:24Z
项目社区:https://github.com/tekintian/alpine

开源协议:

下载


Alpine Docker Container for China User

Change the mirror to mirrors.aliyun.com
Add default time zone for Asia/Shanghai,
For more info about TIME ZONE
Alpine Linux Setting the time zone

ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
Looks like this:
RUN apk add —no-cache tzdata
ENV TZ Asia/Shanghai

tekintian/alpine:latest 安装了openrc 管理工具的 Alpine Docker 镜像

mini install with aliyun cdn

tekintian/alpine:3.9
tekintian/alpine:3.8
tekintian/alpine:3.7
tekintian/alpine:3.6

集成了SSH服务端的alpine 3.8 docker images:
tekintian/alpine:ssh

暴露端口 22 , -p /yourlocaldir:/home 将本地文件夹/yourlocaldir 映射到alpine容器 /home文件夹

docker run -it -d —name alpine -p 22:22 -v /yourlocaldir:/home tekintian/alpine:3.9-ssh

设置SSH登录密码

  1. docker exec -it alpine sh
  2. #设置ROOT用户密码
  3. passwd

Alpine Linux 包管理

  1. apk update
  2. apk search
  3. apk add
  4. apk info
  5. apk upgrade
  6. apk del
  • Alpine Linux服务管理
    rc-update
    rc-status
    rc-service
    openrc

常用的RC系列命令

1.安装软件包实例

  1. # 安装SSHD服务
  2. apk add --no-cache openssh-server
  3. # 增加服务到系统启动时运行,下例为sshd
  4. rc-update add sshd boot
  5. # 安装 nodejs
  6. apk add --no-cache nodejs
  7. #安装Nginx软件并更新到最新,
  8. apk add --update nginx
  9. #手工启动Nginx
  10. /etc/init.d/nginx
  11. #将Nginx添加到启动服务中,下次开机自动运行
  12. rc-update add nginx
  13. # 重启服务
  14. rc-service nginx restart
  15. # 列出所有服务
  16. rc-status -a

运行一个alpine镜像,并安装 openssh

  1. docker run -it --rm alpine /bin/ash
  2. # 更新源
  3. # apk update
  4. # 安装openssh
  5. # apk add openssh
  1. 更新国内源
  2. # Alpine的源文件为:
  3. /etc/apk/repositories
  4. # 本镜像默认的源地址为:http://dl-cdn.alpinelinux.org/
  5. 更换阿里云为中国科技大学的源CDN:
  6. sed -i -e 's/mirrors.aliyun.com/mirrors.ustc.edu.cn/' /etc/apk/repositories
  7. #可以编辑源文件 /etc/apk/repositories,
  8. #采用国内阿里云的源,文件内容为:
  9. https://mirrors.aliyun.com/alpine/v3.9/main/
  10. https://mirrors.aliyun.com/alpine/v3.9/community/
  11. # 如果采用中国科技大学的源,文件内容为:
  12. https://mirrors.ustc.edu.cn/alpine/v3.9/main/
  13. https://mirrors.ustc.edu.cn/alpine/v3.9/community/

/Bitbucket/tools/Alpine

  • 容器build
    ~~~shell

docker build -f 3.9_glibc_i18n.Dockerfile -t tekintian/alpine:3.9glibc-i18n .

docker build -f ssh.Dockerfile -t tekintian/alpine:3.9-ssh .
docker build -f 3.9rc.Dockerfile -t tekintian/alpine:3.9rc .

docker build -f Dockerfile -t tekintian/alpine .

docker build -f 3.10.Dockerfile -t tekintian/alpine:3.10 .

docker build -f 3.9.Dockerfile -t tekintian/alpine:3.9 .
docker build -f 3.8.Dockerfile -t tekintian/alpine:3.8 .
docker build -f 3.7.Dockerfile -t tekintian/alpine:3.7 .
docker build -f 3.6.Dockerfile -t tekintian/alpine:3.6 .

~~~

Support 技术支持

​ 需要其他的特定环境或则模块支持,可联系定制开发容器 , Email: tekintian@gmail.com QQ:932256355

如果您觉得本项目对您有用,请打赏支持开发,谢谢!

donate