Skip to content

lokechenlin/papi-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

About

A docker container for PAPI

Guidelines

To build Docker image

Under the folder with dockerfile

Command:

docker build [OPTIONS] PATH | URL | -

Example:

docker build -t papi-poc:0.3 .

To Run Docker Container under Interaction Terminal

Interaction mode for development

Command:

docker run -it [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...]

Example:

docker run -it --cap-add SYS_PTRACE -p 8081:80 -p 28081:9001 -p 18081:8008 -v /docker/queues/data:/data --name papi-poc papi-poc:0.3

Remarks:

--cap-add means, Add Linux capabilities

SYS_PTRACE means, The ptrace() system call provides a means by which one process (the "tracer") may observe and control the execution of another process (the "tracee"), and examine and change the tracee's memory and registers. It is primarily used to implement breakpoint debugging and system call tracing. To fix some error thrown by supervisor.

To Run Docker Container under Detach Mode

Detach mode for production setup

Command:

docker run -d [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...]

Example:

docker run -d --cap-add SYS_PTRACE --restart=always -p 8081:80 -p 28081:9001 -p 18081:8008 -v /docker/queues/data:/data --name papi-poc papi-poc:0.3

Remarks:

--restart=always means, always restart the container regardless of the exit status. When you specify always, the Docker daemon will try to restart the container indefinitely. The container will also always start on daemon startup, regardless of the current state of the container.

To SSH into Container

First, find the container ID: > docker ps

Then, login to the container Command:

docker exec -i -t CONTAINER bash

Example:

docker exec -i -t b9584c8a4893 bash

To copy a file from container

Command: > docker cp [OPTIONS] CONTAINER:PATH LOCALPATH|-

OR

docker cp [OPTIONS] LOCALPATH|- CONTAINER:PATH

Example:

docker cp papi-poc:/etc/nginx/nginx.conf /vagrant/nginx.conf

Clean up inactive container

You may need higher specification for vagrant instance, i.e. 4 cores and 2 GB RAM > docker rm $(docker ps -a | grep '2 days ago' | awk '{print $1}')

OR remove all

docker rm $(docker ps -a -q)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages