[LINUX] How to log in to Docker + NGINX

Describes how to log in to NGINX started with Docker Compose in the terminal.

First, build the created container image and start the container image. The directory where docker-compose ~ can be executed is the location of docker-compose.yml (Composefile).

Terminal(Build and launch container image)


$ docker-compose build
$ docker-compose up -d
(Can be omitted like the command below)
$ docker-compose up -d --build

Enter.

After booting the image, use the ps command to check the boot status of the image. (You don't have to worry about "The specified path cannot be found.")

$ docker-compose ps
The specified path can not be found.
 Name                Command              State           Ports
------------------------------------------------------------------------
nginx     nginx -g daemon off;            Up      0.0.0.0:80->80/tcp
php-fpm   docker-php-entrypoint php-fpm   Up      0.0.0.0:9000->9000/tcp

You can see that the images named "nginx" and "php-fpm" are running in the Name column. If the State is "Up", it is running. If it says "Exit", it is stopped.

Then, the login command of the main subject is as follows.

$ docker exec -it nginx /bin/sh
/ # 

To log out, just execute the exit command. that's all.

Recommended Posts

How to log in to Docker + NGINX
How to delete log with Docker, not to collect log
How to reflect ImageField in Django + Docker (pillow)
How to allow nologin users to log in on Linux
[Python] How to do PCA in Python
How to handle session in SQLAlchemy
How to use classes in Theano
How to write soberly in pandas
How to collect images in Python
How to update Spyder in Anaconda
How to use SQLite in Python
How to convert 0.5 to 1056964608 in one shot
How to log in automatically like 1Password from the CLI
How to reflect CSS in Django
How to implement Python EXE for Windows in Docker container
How to use Mysql in python
How to wrap C in Python
How to use ChemSpider in Python
How to use PubChem in Python
How to delete a Docker container
How to write Docker base image
How to run TensorFlow 1.0 code in 2.0
How to log in to AtCoder with Python and submit automatically
How to call PyTorch in Julia
How to debug Dash (Flask) in Docker + VSCode + remote connection environment
How to use calculated columns in CASTable
[Introduction to Python] How to use class in Python?
How to suppress display error in matplotlib
How to access environment variables in Python
How to dynamically define variables in Python
How to do R chartr () in Python
How to convert csv to tsv in CLI
How to create an NVIDIA Docker environment
How to get IP when Tornado + nginx
How to delete expired sessions in Django
[Itertools.permutations] How to put permutations in Python
How to implement nested serializer in drf-flex-fields
How to work with BigQuery in Python
Log in to Slack using requests in Python
How to execute commands in jupyter notebook
How to do'git fetch --tags' in GitPython
How to get a stacktrace in python
How to display multiplication table in python
How to reassign index in pandas dataframe
How to use Anaconda interpreter in PyCharm
How to handle consecutive values in MySQL
How to switch python versions in cloud9
How to adjust image contrast in Python
How to use __slots__ in Python class
How to use tensorflow under docker environment
How to dynamically zero pad in Python
How to use regular expressions in Python
How to implement Scroll View in pythonista 1
How to convert DateTimeField format in Django
How to use Map in Android ViewPager
Introduction to docker Create ubuntu environment in ubuntu
How to display Hello world in python
How to read CSV files in Pandas
How to change editor color in PyCharm
How to write this process in Perl?
How to use is and == in Python