Skip to content

Instantly share code, notes, and snippets.

Last active Mar 19, 2019
What would you like to do?
Commands example docker
docker ps -a
docker images
docker start unichem
docker stop unichem
# Runs a redis container exposing port 6379 on local machine
docker run --name redis --rm -p 6379:6379 redis
# Runs the latest version of a mongo image deattached
docker run -d -p 27017:27017 mongo:latest
# Build a Dockerfile and set 'chembl/glados' as name for the image
docker build -t chembl/glados .
docker exec -it unichem bash
version: "3"
build: .
container_name: tuto
image: chemblgroup/testimage
# Select original image
FROM python:3
# Labels
LABEL maintainer=""
# Adding the file
ADD /opt/
# Commands to run once instanced
ENTRYPOINT [ "python", "/opt/" ]

Docker Tutorial

## Running images

docker run -d -p 27017:27017 mongo:latest

docker network create elastic-stack

docker network ls

docker run --network=elastic-stack --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node"
docker run --network=elastic-stack --name kibana -e ELASTICSEARCH_HOSTS=http://elasticsearch:9200 -p 5601:5601

## Building your own image


  1. Choose a base image
  2. Add files
  3. Define an entrypoint
docker build -t chemblgroup/testimage .
docker run --name tuto chemblgroup/testimage

docker-compose up
docker-compose down

docker-compose up --build
docker-compose stop
docker-compose start

docker push chemblgroup/testimage:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment