Skip to content

Git | Docker | Jenkins | Nginx | Deployments #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
raunak-r opened this issue Apr 13, 2020 · 5 comments
Open

Git | Docker | Jenkins | Nginx | Deployments #6

raunak-r opened this issue Apr 13, 2020 · 5 comments

Comments

@raunak-r
Copy link
Owner Author

raunak-r commented Apr 13, 2020

DOCKER

Optimizations

Helped me to know that it was the docker container that was talking all my space so i push all my container to my docker registry then did sudo rm -rf /var/lib/docker/ it cleared up my space :) hope it helps someone :)
> sudo rm -rf /var/lib/docker/
> sudo service docker restart

Commands

  • sudo docker rmi $(sudo docker images -q) -f

  • sudo docker system prune

  • BUILD
    --- sudo docker build --network=host -t ImageName .
    --- sudo docker build --network=host -t imageName -f ./filepath/dockerfile .

  • RUN
    --- sudo docker run -d --network=host ImageName
    --- sudo docker run -d --network=host -e environment='' --log-opt max-size=10m imageName

  • RUNNING
    --- sudo docker ps -q

  • STOP
    --- sudo docker stop CID
    --- sudo docker stop $(sudo docker ps -q)

  • BASH
    --- sudo docker exec -it CID /bin/bash
    --- sudo docker exec -it $(sudo docker ps -q) /bin/bash # to access the bash of a running container.
    --- sudo docker run -it --entrypoint /bin/bash IMAGE_NAME # to run an image as a bash container.

  • LOGS
    --- sudo docker logs CID --follow
    --- sudo docker logs $(sudo docker ps -q) --follow # when there is only image running.

Docker UI

docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer
And point your browser to http://localhost:9000.

Study Notes

. -d arg to run container in background.
. see running images, stopping containers.
. network equal host mode to access local ips.
. putting env variables in dockerfile.
. connecting to local psql from docker instance

@raunak-r
Copy link
Owner Author

raunak-r commented Apr 13, 2020

@raunak-r
Copy link
Owner Author

raunak-r commented Apr 13, 2020

Nginx

> user  nobody nogroup;
https://serverfault.com/a/901176

> Use sudo nginx -t to test the complete configuration file, which starts at nginx.conf and pulls in additional fragments using the include directive. See this document for more.

/etc/nginx/
> sudo nginx -t -c /etc/nginx/nginx.conf

# logs
> /usr/local/var/log/nginx/*
> tail -f /var/log/nginx/error.log
> tail -f /var/log/nginx/access.log /var/log/nginx/error.log

# angular routing
> https://stackoverflow.com/questions/35038155/how-to-redirect-all-angular-request-to-index-html-in-nginx

@raunak-r
Copy link
Owner Author

Kubernetes

@raunak-r
Copy link
Owner Author

raunak-r commented Nov 20, 2020

@raunak-r raunak-r changed the title Git | Docker | Jenkins Git | Docker | Jenkins | Deployments Nov 20, 2020
@raunak-r raunak-r changed the title Git | Docker | Jenkins | Deployments Git | Docker | Jenkins | Nginx | Deployments Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant