Taha Ozket edited this page Jun 2, 2018 · 7 revisions

Instainer Documentation

Accessing Container Data

After creating container on instainer automatically creates a Git repo and Git user for your volumes and pushes volume data to repository. You can easily clone Git repo and make changes then push them to back Instainer Git Repo. After pushing your changes instainer detects changes and deploys your changes to your container.

Create a container using instainer cli add -v parameter to create a Git repository for specified directory.

instainer run -v /usr/share/nginx/html nginx

Container Details

Copy Git URL and Git access information from response;

------------Git Information------------
Git User      = 1bd743c9
Git Password  = 47b2a89a

----------Volumes Information----------
/usr/share/nginx/html
Git URL  = http://git.instainer.io/1bd743c9/caf20a1d.git

Clone repository, change file and push your changes

git clone http://<USERNAME>@git.instainer.io/<REPO_NAME>
echo “Hi from instainer” > index.html
git add index.html
git commit -m “index.html changed”

Check your nginx container via web browser

------------Port Information------------
Container Port    80/tcp
Instainer Port    instainer.io:32841

Instainer REST API Documentation

Run container

POST http://api.instainer.com/container/run?image=nginx

Run container with custom parameters

POST http://api.instainer.com/container/run?image=nginx
{
    volumeDirs: [
    	“/usr/src/local/html”,
    	“/app”
],
envVars: [
	{“MYSQL_ROOT_PASS”:”S3C3ET”}
    ]
}

volumeDirs: Defined dirs will be deployable over Git

envVars: Will be use when running container

Image Search

GET http://api.instainer.com/container/search?image=nginx

Docker Compose Up

POST http://api.instainer.com/compose/up
Request Body : docker-compose.yml content

Container Logs

GET http://api.instainer.com/container/CONTAINER_ID/logs

Instainer CLI Commands

Basic Commands

Running a container

instainer run nginx

Listing containers

instainer ps

Custom volume management

instainer run -v /var/www/html nginx

Custom environment variables

instainer run -e MYSQL_ROOT_PASSWORD=v3rys3cR3t mysql

Compose Commands

Running containers with docker-compose.yml

instainer compose up docker-compose.yml

Container Commands

Accessing logs

instainer logs  <CONTAINER_ID>

Executing commands on container

instainer exec <CONTAINER_ID> command

Access to container’s bash

instainer bash <CONTAINER_ID>
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.