I'm having a hard time running a container from the Ghost image in development (after docker pull ghost).
Using:
docker run --name some-ghost -p 4000:2368 -v /Users/Documents/ghost-blog/content/themes/:/var/lib/ghost/content/themes/ -e NODE_ENV=development ghost
seems to start the container in development but when I navigate to the page in browser I get
localhost didn’t send any data. ERR_EMPTY_RESPONSE
I've tried looking this up but it seems like development was previously the default environment until recently. I'm not really sure where to proceed.
According to acburdine's answer, you need to specify further environment variables:
docker run --name some-ghost -p 4000:2368 -v /Users/Documents/ghost-blog/content/themes/:/var/lib/ghost/content/themes/ -e NODE_ENV=development -e server__host=0.0.0.0 -e url="http://localhost:2368" ghost
Related
I'm trying to launch SQL Server for a technical test on my Macbook. Docker seemed to be best solution.
Tried using instructions from https://database.guide/how-to-install-sql-server-on-an-m1-mac-arm64/
Installed Docker okay.
Then tried to use:
sudo docker run --cap-add SYS_PTRACE -e 'ACCEPT_EULA=1' -e 'MSSQL_SA_PASSWORD=bigStrongPwd' -p 1433:1433 --name sqledge -d mcr.microsoft.com/azure-sql-edge
But when I tried to test the Docker using:
docker ps
The result was this:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
What's gone wrong?
From within my docker pgadmin container, I want to access a postgresql backup file located in my windows10 OS.
So I'm trying to set up a shared directory.
Running this command works fine. Directory is linked to the container.
docker run --name=windows10 -d -v C:\Users\johndoe:/windows10 -p 5554:80 dpage/pgadmin4 -e PGADMIN_DEFAULT_EMAIL=john#doe.com -e PGADMIN_DEFAULT_PASSWORD=whatever
However, the directory won't mount because it's giving this error log on startup:
You need to specify PGADMIN_DEFAULT_EMAIL and PGADMIN_DEFAULT_PASSWORD environment variables
What is this sorcery??
Move the environment variables to before the image name
docker run --name=windows10 -d -v C:\Users\johndoe:/windows10 -p 5554:80 -e PGADMIN_DEFAULT_EMAIL=john#doe.com -e PGADMIN_DEFAULT_PASSWORD=whatever dpage/pgadmin4
-e is an option and must be specified between run and IMAGE (see https://docs.docker.com/engine/reference/commandline/run/)
I created a docker file that install my application for php and dependencies then use composer to install vendor packages all in docker container.
This container will link to MongoDB and Nginx to run.
It's ok for development but my question is it's ok to deploy my production env?
Consider in my production server I will install docker then run below command:
docker run --name MongoDB -d --rm mongodb:latest
docker run --name app --link MongoDb:mongodb -p 9000:9000 -d --rm myrepo/myapp:latest
docker run --link app:app --name Nginx --rm -d Nginx:latest
And then enter my domain.com and my production server using this dockers to run my app.
It's ok and stable?
You may want to use docker compose to setup the three as services and deploy the whole thing as one stack using docker-compose up
See this page for a sample
I am using Postgres image and past broker image in my docker machine for setting up pact broker.
here are 4 steps that have mentioned :
1.$ docker run --name pactbroker-db -e POSTGRES_PASSWORD=ThePostgresPassword -e POSTGRES_USER=admin -e PGDATA=/var/lib/postgresql/data/pgdata -v /var/lib/postgresql/data:/var/lib/postgresql/data -d postgres
2.$ docker run -it --link pactbroker-db:postgres --rm postgres sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U admin'
3.
CREATE USER pactbrokeruser WITH PASSWORD 'TheUserPassword';
CREATE DATABASE pactbroker WITH OWNER pactbrokeruser;
GRANT ALL PRIVILEGES ON DATABASE pactbroker TO pactbrokeruser;
4. docker run --name pactbroker --link pactbroker-db:postgres -e PACT_BROKER_DATABASE_USERNAME=pactbrokeruser -e PACT_BROKER_DATABASE_PASSWORD=TheUserPassword -e PACT_BROKER_DATABASE_HOST=postgres -e PACT_BROKER_DATABASE_NAME=pactbroker -d -p 80:80 dius/pact_broker
after running this 4 command when I am opening Hal browser in my local system it is working pretty fine. Now I am stopping 2 docker containers pactbroker-db and pactbroker and stopping docker machine.
After sometime I am restarting docker machine and starting the containers by
$docker start pactbroker-db and $docker start pactbroker .
containers are getting started but when opening HAL browser I am getting the error "We're sorry, but something went wrong." screenshot attached.
Is there something wrong when I am starting the docker 2nd time?enter image description here
This has been resolved by using container given in https://github.com/DiUS/pact_broker-docker and using proper environment variables in docker-compose.yml of this project.
I am trying with Kong. Iam running this on AWS. Whenever I stop the server and start it every entry in the APIs and Plugins will go. so after each and evry start and stop I have to re-add the values for api and plugins. Can any one tell me how can I retain the data ?
docker run -d --name kong-database -p 9042:9042 cassandra:2.2 then I ran the image for kong
docker run -d --name kong --link kong-database:kong-database
-e KONG_DATABASE=cassandra" -e "KONG_CASSANDRA_CONTACT_POINTS=kong-database"
-e "KONG_PG_HOST=kong-database" -p 8000:8000 -p 8443:8443 -p 8001:8001
-p 7946:7946 -p 7946:7946/udp kong
please help me on this.
I found one solution. the steps which I did
1. take the snapshot of the cassandra keyspace using nodetool.
2. copy the snapshot of the tables which you want to restore
3. copy the snapshot to the tables of destination server
4. refresh the tables using nodetool
5. refresh the kong url , you can see the data updated there.