Sergej Chodarev (sergejx.net)
A computer will execute the same instructions, in the same order, time after time.
#!/bin/sh
echo "Hello!"
#!/bin/bash
#!/usr/bin/env python
#!/usr/bin/env python3
Use the shell when graphical user interfaces don’t cut it.
targets: prerequisites
recipe
recipe…
make target
.PHONY: clean
clean:
rm *.o temp
$@
- target file name#<
- first prerequisite namepackage-lock.json
Pipfile.lock
requirements.txt
git clone ...
cd project
Containers — standardized units for development, shipment and deployment
<?php
echo("Hello world!");
Dependencies:
FROM php:7.2-apache-stretch
COPY src /var/www/html
$ docker build -t hello-php .
$ docker run -p 8000:80 --name running-hello hello-php
-v <volume-name>:<container-path>
-v <host-path>:<container-path>
FROM php:7.2-apache-stretch
COPY src /var/www/html
VOLUME /var/www/html/uploads
docker run -p 8000:80 -v "$(pwd)"/src:/var/www/html hello-php
docker run -p 8000:80 -v d:/hello/src:/var/www/html hello-php
<?php
$conn = new mysqli(
"db-server", "user", "my-password", "hello");
if ($conn->connect_error)
die("Oh, no! Connection failed!");
echo "Hello MariaDB!";
FROM php:7.2-apache-stretch
RUN docker-php-ext-install mysqli
COPY src /var/www/html
services:
web:
build: .
image: hello-php
ports:
- "8000:80"
volumes:
- ./src:/var/www/html
db-server:
image: mariadb:10.3
environment:
MYSQL_ROOT_PASSWORD: my-root-pwd
MYSQL_DATABASE: hello
MYSQL_USER: user
MYSQL_PASSWORD: my-password
$ docker-compose build web
$ docker-compose up
$ docker-compose down
Use commits or pushes to trigger builds, tests, releases. Use a version control tag to deploy to production.