Build Apache Docker Image from Alpine: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 49: Line 49:


==References==
==References==
* [https://wiki.alpinelinux.org/wiki/Setting_Up_Apache_with_PHP Setting Up Apache with PHP]
* [https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management Alpine Linux package management]
* [https://pkgs.alpinelinux.org/packages Alpine Linux Packages Search]
* [https://pkgs.alpinelinux.org/packages Alpine Linux Packages Search]
* [https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management Alpine Linux package management]
* [https://askubuntu.com/questions/815066 /etc/profile vs /etc/bash.bashrc]
* [https://askubuntu.com/questions/815066 /etc/profile vs /etc/bash.bashrc]
* [https://wiki.alpinelinux.org/wiki/Setting_Up_Apache_with_PHP Setting Up Apache with PHP]
* [https://github.com/docker-library/httpd/tree/38842a5d4cdd44ff4888e8540c0da99009790d01/2.4/alpine Alpine Apache Docker]

Latest revision as of 06:32, 25 August 2018

Good to Know

# filter and remove docker images, containers 
docker rm $(docker ps --all -q -f status=dead)
docker rmi $(docker images -qa -f 'dangling=true')
docker rm alpine && docker rmi alpine:3.8

# docker container debug, checking history & service
docker run --name='alpine' -it alpine:3.8
docker exec -it alpine /bin/bash
docker exec -it alpine bash
docker history alpine:3.8
docker logs alpine

# alpine linux install packages
apk add apache2 php5-apache2 --no-cache
apk add apache2-ctl --no-cache
apk add openjdk8 --no-cache
apk add php5-cli --no-cache
apk add openrc --no-cache
apk add wget --no-cache
apk add vim --no-cache

# ftpget, ftpput, telnet, tftp, ftpd, httpd
apk add -u busybox --no-cache
apk add busybox-extras --no-cache

# alpine linux uninstall packages
apk del busybox-extras 
apk del php5-cli

# alpine linux services
rc-service apache2 start
rc-update add apache2
rc-status --crashed
rc-status --manual
rc-status --list

# configuration of environment variables 
export JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk
export JRE_HOME=$JAVA_HOME/jre
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin

# configuration check
echo 'ServerName localhost' >>/etc/apache2/conf.d/fqdn.conf
apachectl -t
httpd -t

References