Skip to main content

sudo docker ps and exec -it

Working in an AWS ec2 environment, my goal is to access the server via terminal.

I initially work to get the instance ID.  With this ID, I'm able to connect to the server.  When first accessing the environment on the server the steps I take are:

sudo docker ps

ps - refers to the 'process status'

Response

Docker steps for rebuilding

Docker containers list

To view a list of Docker containers that are currently running, you can use the docker ps command. Open your terminal or command prompt and run the following command:

docker ps

This command will display a list of running containers, showing information like the container ID, image name, status, ports, and more.

Docker - Warning: copy(): SSL operation failed with code 1. OpenSSL Error messages:

Build the PHP base image with apache-buster using the Dockerfile.base

Since JN blocks some libraries update and pull, follow the following steps to build the base image locally.

Run the following command to build the base PHP image:
Make sure you are in the project root directory before running the command and its a fresh window after changing the proxy

Building a Drupal or Laravel instance on OSX using Lando and Docker

As a web developer, you will most likely need to run local copies of a bunch of different web sites. Regularly switching between several sites daily.  Sometime Drupal, other Laravel and whatever frameworks that are in your toolkit.

 

Install Docker and Lando

Do you have Docker installed?  No, then go to the Docker Desktop page and download.

Mariadb hangs on start up in Docker

Running Docker and attempting to install a web proxy environment where I'm attempting to create local web set up the consist of Drupal 9 with Composer + Docker-compose + Nginx + MariaDB + PHP8.1

However, when I run the command

docker-compose up

The terminal hangs at

xdebug error

xdebug - failed to solve with frontend dockerfile.v0: failed to create LLB definition: dockerfile parse error line 45: unknown instruction: ZEND_EXTENSION=XDEBUG.SO

 

How I got here

Running the following Docker command

docker-compose up

Generated this output:

Run Drupal 9 with Composer + Docker-compose + Nginx + MariaDB + PHP8.1

Running Docker

Dangerous word... I'm assuming that Docker is installed.  Don't know how to check?  Using Terminal (I prefer iTerm2), run the following command

docker -D info

 

The set-up

Go to your project directory, and create a docker folder and a “docker-compose.yml” file:

Docker - creating a container / image

Create and push to Docker Hub

Creating your own custom image... you need to have a Docker ID.  Not sure, well most likely you created it to download Docker Desktop.  If you don't have one, go to Docker and sign up.

In your  text editor create a file called Dockerfile in the same directory you want to have as your local site. No extension, just Dockerfile. Paste in this code and save the file:

Resetting Docker

Resetting Docker is basically following the start parameters.  All containers removed -

No containers running

Try running a container: Copy and paste this command into your terminal

docker run -d -p 80:80 docker/getting-started

Unable to find image 'docker/getting-started:latest' locally
latest: Pulling from docker/getting-started

 

Setting up a new local site environment

Setting up a new project in Docker and VS Code.

Using Terminal, go to your Sites directory and create a new directory using the mkdir command.  In this instance I'm going to create a new directory titled ADCE

shortcut command to access the Sites directory

cd ~/Sites

Create the new directory

mkdir ADCE

Go in to the new directory

cd ADCE

Run the devcontainer command

Subscribe to Docker