Skip to content

Instantly share code, notes, and snippets.

@farukterzioglu
Last active September 6, 2018 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save farukterzioglu/70af7d763215c04a61e6629ef52d7f93 to your computer and use it in GitHub Desktop.
Save farukterzioglu/70af7d763215c04a61e6629ef52d7f93 to your computer and use it in GitHub Desktop.
Docker notes
docker run -p 5000:80 -e CORE_ENVIRONMENT=prod similarityapi
docker run -p 5000:80 -e NETCORE_ENVIRONMENT=test similarityapi
https://git.hepsiburada.com/Hermes/product-similarity-finder.git
//dotnet docker file örnekleri
https://github.com/dotnet/dotnet-docker/tree/master/samples/dotnetapp
https://github.com/dotnet/dotnet-docker/blob/master/samples/dotnetapp/dotnet-docker-unit-testing.md
docker build --pull --target testrunner -t dotnetapp:test .
docker run --rm -v C:\git\dotnet-docker\samples\dotnetapp\TestResults:/app/tests/TestResults dotnetapp:test
docker run --rm -v "$(pwd)"/TestResults:/app/tests/TestResults dotnetapp:test
//ENGINEAPP
//engineapp uygulamasının release & test build i
docker build -f .\build\docker\engineApp\Dockerfile -t engineapp:latest .
docker build -f .\build\docker\engineApp\Dockerfile -t engineapp:test --target testrunner .
//engineapp run & test
docker run --rm engineapp
docker run --rm -it engineapp:test
//STREAMER
//streamer release & test build i
docker build -f .\build\docker\streamer\Dockerfile -t streamer:latest .
docker build -f .\build\docker\streamer\Dockerfile -t streamer:test --target testrunner .
//streamer run & test (streamer testi fail oluyor. CI da test edebilmek için)
docker run --rm streamer
docker run --rm -it streamer:test
//Test result outout ???
docker run --rm -v C:\Logs\Streamer\TestResults:/app/test/TestResults streamer:test
docker run --rm -v "$(pwd)"/Logs/Streamer/TestResults:/app/test/TestResults dotnetapp:test
docker image prune -f
bin/bash notes;
ls ./build/ ....
docker ps -lq
docker commit $(docker ps -lq) awesomeness
docker run awesomeness hello
docker run --entrypoint ls historical:latest
docker run historical:latest -e test --startTime 2018-07-01 --endTime 2018-07-24 --processNotPurchasedReviews
docker run -it --rm -p 9200:9200 -p 5601:5601 --name esk nshou/elasticsearch-kibana
-it means starting the container in interactive mode with a terminal attached.
--rm means the container will be removed as soon as you exit from the terminal.
-p maps a port inside the container with a port in the host
--name gives the container a name in case you don’t use --rm and prefer to manually stop/remove
nshou/elasticsearch-kibana is the name of an image in Docker Hub that someone already prepared with Elasticsearch and Kibana inside
If you prefer so, you can start it in the background using the argument -d instead, and manually stopping/removing it using docker stop esk and docker rm esk.
docker inspect <containerNameOrId>
docker inspect --format='{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq)
docker run -i -t --entrypoint /bin/bash <imageID>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment