docker-images/pluie/alpine/README.md

84 lines
2.1 KiB
Markdown
Raw Normal View History

2016-07-25 00:28:26 +00:00
# pluie/alpine
2016-07-25 00:26:39 +00:00
This Image provide a Linux Alpine distribution with :
- fully functionnal & colorized terminal
- bash
- curl
- nano as editor
2016-07-29 11:51:56 +00:00
Base image : [alpine:3.4] (https://hub.docker.com/_/alpine/)
2016-07-25 00:26:39 +00:00
2016-07-25 00:28:26 +00:00
This project come with a structure to facilitate further images (like pluie/alpine-apache & pluie/alpine-mysql)
2016-07-28 15:43:35 +00:00
## Image Size
2016-07-25 00:28:26 +00:00
- very small image < 10 MB
2016-07-28 15:47:04 +00:00
## Image Usage
2016-07-25 00:28:26 +00:00
```
2016-07-29 09:22:14 +00:00
$ docker run --name alpine -it pluie/alpine
2016-07-25 00:28:26 +00:00
```
2016-07-28 15:43:35 +00:00
## Image Structure
2016-07-25 00:28:26 +00:00
```
project/
|
|-- install.d/ # deployed in /scripts on target container
| | # launch on docker image building process
| | # XX-name.sh - low XX are run first
| |-- 00-util.sh
| |-- 40-fix.sh
|
|-- pre-init.d/ # deployed in /scripts on target container
| | # launch on docker container running process
| |-- 50-example.sh
|
|-- build # build docker image : ./build [TAG]
|-- common.sh # don't modify - sourced by main.sh to execute pre-init.d scripts first
|-- install.sh # don't modify - execute install.d scripts on docker building process
|-- main.sh # source common.sh then execute entry point instruction
|-- util.sh # sourced by common.sh
```
2016-07-25 00:26:39 +00:00
you can easily create your own images based on this structure.
keep an eye to pluie/alpine-apache & pluie/alpine-mysql wich extend pluie/alpine
2016-07-25 00:28:26 +00:00
## Extend pluie/alpine Image
2016-07-25 00:26:39 +00:00
RUN instructions are minimized
2016-07-25 00:28:26 +00:00
on extended image you can only use :
```
RUN bash /scripts/install.sh
```
2016-07-25 00:26:39 +00:00
add your packages in a script in install.d directory
keep name below 40 because install.d/40-fix.sh clean package repository
2016-07-25 00:28:26 +00:00
each extended image inherit install.d && pre-init.d scripts
2016-07-25 00:26:39 +00:00
extended images doesn't need to define ENTRYPOINT
you can keep intact build script in each extended project
manage your install & init instruction in install.d & pre-init.d directory
and write your own main.sh script
Docker file example (from pluie/alpine-apache)
```
FROM pluie/alpine
MAINTAINER a-Sansara https://github.com/a-sansara
ADD files.tar /scripts
RUN bash /scripts/install.sh
EXPOSE 80
VOLUME /app
```
2016-07-25 00:28:26 +00:00