Docker

cleanup

~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2
never shrinks...

Dockerfile recipes

Java hello

FROM openjdk:14-alpine
COPY out/artifacts/testdockerhello_jar/testdockerhello.jar /usr/src/hello.jar
CMD java -cp /usr/src/hello.jar Main

Spring basic

with maven pom.

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
        <finalName>docker-spring-demo</finalName>
    </build>

Dockerfile
FROM openjdk:11

EXPOSE 8080

ADD target/docker-spring-demo.jar app.jar

ENTRYPOINT ["java","-jar", "app.jar"]

Mysql recipe

docker run --name mysql -e MYSQL_USER=user -e MYSQL_PASSWORD=password -e MYSQL_DATABASE=databasename -p 3306:3306 -d mysql/mysql-server

Sails

run sails from local dir in docker conatiner
docker container run -it -p 1337:1337 -v $(pwd):/server artificial/docker-sails /bin/bash

Swift

run docker app
then

docker pull swift
docker pull postgres:alpine

docker container run -d -p 3306:3306 --name mysql -e MYSQL_RANDOM_ROOT_PASSWORD=yes  mysql
docker container run --name mysql -p 3306:3306 -e MYSQL_RANDOM_ROOT_PASSWORD=yes -d mysql
docker container logs mysql
docker exec -it mysql bash -l

docker container run -d --name mysql -e MYSQL_ROOT_PASSWORD=root -p 3306 -v /Users/lappie2010/Documents/docker/mysql/:/var/lib/mysql mysql


docker container logs mysql

docker container run -d --name webserver -p 8080:80 httpd

docker container run -d --name proxy -p 80:80 nginx


docker run --cap-add sys_ptrace -it --privileged=true swift bash

Docker Mysql + Wordpress

docker container run -d \
    --name wordpress \
--link mysql:mysql\
    -p 8080:80 \
    -e WORDPRESS_DB_PASSWORD=root \
    wordpress

    docker container run -d \
        --name mysql \
        -e MYSQL_ROOT_PASSWORD=root \
        -e MYSQL_DATABASE=wordpress \
        mysql