Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
tools:docker [2022/07/15 16:18] darron |
tools:docker [2022/07/17 16:09] darron [Docker file] |
||
---|---|---|---|
Line 4: | Line 4: | ||
application within its jailed system rather than being a lightweight | application within its jailed system rather than being a lightweight | ||
VM. It's like having a chroot management system enhanced with networking. One side | VM. It's like having a chroot management system enhanced with networking. One side | ||
- | effect of not having an init process is zombie processes can accumulate in the container. Docker is also dependant on the overlay2 file system. In use this is very slow. | + | effect of not having an init process is zombie processes can accumulate in the container. Docker is also dependant on the overlay2 file system |
Docker has a lot of pre-built applications, | Docker has a lot of pre-built applications, | ||
Line 233: | Line 233: | ||
===WordPress=== | ===WordPress=== | ||
+ | |||
+ | This is the process I used to develop a WordPress docker container. Following this is | ||
+ | the method using a Dockerfile which automates the process once it is known. Some differences | ||
+ | are also found in the application of the container during development. | ||
==Proxy== | ==Proxy== | ||
Line 355: | Line 359: | ||
</ | </ | ||
- | ===Docker file=== | + | ===WordPress Dockerfile=== |
A docker file can be used to automate the building of an image after one | A docker file can be used to automate the building of an image after one | ||
has been developed. | has been developed. | ||
- | Example | + | Here is a simple Makefile just used to contain various rules. |
- | + | ||
- | Create | + | |
< | < | ||
- | FROM alpine:latest | + | clean: |
- | RUN apk update | + | rm -f *~ |
- | ENTRYPOINT ["/ | + | |
- | </ | + | |
- | Build | + | build: |
+ | docker build --no-cache -t alpine_wp . | ||
- | < | + | run: |
- | docker | + | docker |
+ | |||
+ | test: | ||
+ | curl -v http:// | ||
+ | |||
+ | stop: | ||
+ | docker stop wp-dev | ||
+ | |||
+ | rm: | ||
+ | docker rm -f wp-dev | ||
+ | docker image rm -f alpine_wp | ||
</ | </ | ||
- | List | + | The Makefile uses a Dockerfile to make the build, as follows: |
< | < | ||
- | docker image list alpine_test | + | # LATEST WORDPRESS ON ALPINE LINUX |
- | REPOSITORY | + | FROM alpine: |
- | alpine_test | + | # INSTALL APACHE2/ |
+ | RUN apk --no-cache update && apk --no-cache upgrade && apk --no-cache add php8 php8-apache2 php8-mysqli php8-mysqlnd php8-opcache php8-cli php8-ctype php8-iconv php8-session php8-simplexml php8-tokenizer php8-openssl php8-phar php8-curl php8-dom php8-exif php8-fileinfo php8-pecl-imagick php8-mbstring php8-zip php8-gd php-intl && ln -sf / | ||
+ | # INSTALL WORDPRESS | ||
+ | WORKDIR / | ||
+ | RUN wget -q " | ||
+ | # START HTTPD | ||
+ | EXPOSE 80 | ||
+ | ENTRYPOINT / | ||
</ | </ | ||