Skip to content

Instantly share code, notes, and snippets.

@ricardoaat
Last active Mar 19, 2019
Embed
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"
services:
testimage:
build: .
container_name: tuto
image: chemblgroup/testimage
# Select original image
FROM python:3
# Labels
LABEL maintainer="arcila@ebi.ac.uk"
# Adding the file
ADD smallapp.py /opt/
# Commands to run once instanced
ENTRYPOINT [ "python", "/opt/smallapp.py" ]

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.elastic.co/elasticsearch/elasticsearch:6.6.1
docker run --network=elastic-stack --name kibana -e ELASTICSEARCH_HOSTS=http://elasticsearch:9200 -p 5601:5601 docker.elastic.co/kibana/kibana:6.6.1

## Building your own image

/Users/arcila/ebi/dev/ChEMBL/docker-tutorial

  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