First commit
This commit is contained in:
commit
6a5e70ccf2
|
@ -0,0 +1,2 @@
|
|||
/Dockerfile
|
||||
/mount/*
|
|
@ -0,0 +1,35 @@
|
|||
IMAGE_NAME="alp-mdb"
|
||||
|
||||
build: clean Dockerfile
|
||||
@echo -n "> Building image...............";
|
||||
docker build --force-rm -t $(IMAGE_NAME) . && echo "done" || echo "error";
|
||||
|
||||
Dockerfile: docker/main docker/include/*
|
||||
@echo -n "> Building file Dockerfile.....";
|
||||
@cpp -o Dockerfile docker/main && echo "done" || echo "error";
|
||||
|
||||
clean:
|
||||
@echo -n "> Stopping containers..........";
|
||||
@docker stop inst1;
|
||||
@docker rm -flv inst1;
|
||||
@echo -n "> Deleting docker image........";
|
||||
@docker rmi -f $(IMAGE_NAME) && echo "done" || echo "failed";
|
||||
@echo -n "> Deleting Dockerfile..........";
|
||||
@rm Dockerfile && echo "done" || echo "failed";
|
||||
|
||||
boot:
|
||||
@while true; do \
|
||||
echo "*** 1. Updating virtual environment"; \
|
||||
git pull origin stable; \
|
||||
echo "*** 2. Building image"; \
|
||||
make build; \
|
||||
echo "*** 3. Launching container"; \
|
||||
docker run --name inst1 $(IMAGE_NAME); \
|
||||
echo "*** 4. Deleting container"; \
|
||||
docker stop inst1; \
|
||||
docker rm -flv inst1; \
|
||||
sleep 2; \
|
||||
done;
|
||||
|
||||
kill:
|
||||
@docker exec -ti inst1 sh -c 'rm boot.lock';
|
|
@ -0,0 +1,4 @@
|
|||
RUN apk add mariadb mariadb-client \ /* 1. install mariadb */
|
||||
&& mysql_install_db --user=mysql \ /* 2. install database */
|
||||
&& sh -c 'mysqld_safe& sleep 1' \ /* 3. Start mysql for password changing */
|
||||
&& mysqladmin -u root password 'root' /* 4. set arbitrary root password */
|
|
@ -0,0 +1,19 @@
|
|||
/* 1. Base image */
|
||||
FROM alpine
|
||||
MAINTAINER xdrm-brackets <xdrm.brackets.dev@gmail.com>
|
||||
|
||||
/* 2. Update package manager */
|
||||
RUN apk update
|
||||
|
||||
|
||||
/************************************
|
||||
************** MariaDB **************
|
||||
************************************/
|
||||
#include "./include/mariadb"
|
||||
|
||||
|
||||
/************************************
|
||||
********** Set Bootloader ***********
|
||||
************************************/
|
||||
COPY virtual/bootloader /bootloader
|
||||
CMD export USER=ROOT; sh /bootloader
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
# 1. Start mysql
|
||||
nohup mysqld_safe > /var/log/mysql_log &
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# 10. Create lock file
|
||||
touch /boot.lock;
|
||||
chmod 777 /boot.lock;
|
||||
|
||||
# 11. Run while lock exists
|
||||
while [ -f /boot.lock ]; do sleep 1; done;
|
Loading…
Reference in New Issue