Please enable JavaScript.
Coggle requires JavaScript to display documents.
DOCKER (ACTIONS WITH (Containers (List: (All stopped containers:
docker…
DOCKER
ACTIONS WITH
-
Images:
- image name can be only lowcase
- 2 words are separated with '-'
- is based on particular OS
Remove:
-
-
- docker rmi -f imageId
- docker rmi -f imageName
// -f == force
-
-
-
-
General
-
-
docker stats containerId:
displays the CPU, memory, and network I/O for each image.
WorkFlow:
HTML web app
- create Dockerfile
- Build image:
docker build -t imageName .
// . - current directory
// image name can be only lowercase
- run image in container:
docker run -p 8080:80 imageName
// 8080 - my port
// 80 - port in docker file
- docker stop containerID
JAVA app:
- Create java file.txt
- Compile it: javac HelloWorld.java
- Create dockerfile in current directory
FROM alpine:latest
ADD HelloWorld.class HelloWorld.class
RUN apk --update add openjdk8-jre
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "HelloWorld"]
- docker build --tag "imageName" .
- docker run imageName
-
Java Jar:
- Docker file:
FROM anapsix/alpine-java
MAINTAINER igorGocnhar
COPY DockerJarProject.jar /home/DockerJarProject.jar
CMD ["java","-jar","/home/DockerJarProject.jar"]
-
Docker Compose install:
Docker Compose is an open-source tool for defining and running multi-container applications using a declarative approach
Check version:
docker-compose --version
Arguments:
run
-d : detached mode
- containers started in detached mode exit when the root process used to run the container exits
- container in detached mode cannot be automatically removed when it stops, this means you cannot use the --rm option with -d option
-
-
-