How can i use exec for contrainer bash when the container won't start in Docker?How do I edit a file after I shell to a Docker container?How to list containers in DockerHow to remove old Docker containersHow to mount a host directory in a Docker containerFrom inside of a Docker container, how do I connect to the localhost of the machine?How to upgrade docker container after its image changedHow do I pass environment variables to Docker containers?Deploying docker on AWS Beanstalk only serves html files, no other filesDocker PHP-APACHE container set the ServerName directive globallyUnable to open primary script (Permission denied)docker image for php is not working on browser for windows 10
Is there a word for food that's gone 'bad', but is still edible?
What is a common way to tell if an academic is "above average," or outstanding in their field? Is their h-index (Hirsh index) one of them?
Why does sound not move through a wall?
Why didn't this character get a funeral at the end of Avengers: Endgame?
Gerrymandering Puzzle - Rig the Election
Out of scope work duties and resignation
Endgame puzzle: How to avoid stalemate and win?
Is it normal for gliders not to have attitude indicators?
What do "Sech" and "Vich" mean in this sentence?
How can internet speed be 10 times slower without a router than when using a router?
Is there an age requirement to play in Adventurers League?
How to deal with employer who keeps me at work after working hours
Is 'contemporary' ambiguous and if so is there a better word?
Can there be a single technologically advanced nation, in a continent full of non-technologically advanced nations?
Find magical solution to magical equation
Is an HNN extension of a virtually torsion-free group virtually torsion-free?
Why would a military not separate its forces into different branches?
Prove that a definite integral is an infinite sum
To kill a cuckoo
Is “snitty” a popular American English term? What is its origin?
How to ask systemd to not start a system service on boot?
How long would it take for people to notice a mass disappearance?
Is disk brake effectiveness mitigated by tyres losing traction under strong braking?
Will 700 more planes a day fly because of the Heathrow expansion?
How can i use exec for contrainer bash when the container won't start in Docker?
How do I edit a file after I shell to a Docker container?How to list containers in DockerHow to remove old Docker containersHow to mount a host directory in a Docker containerFrom inside of a Docker container, how do I connect to the localhost of the machine?How to upgrade docker container after its image changedHow do I pass environment variables to Docker containers?Deploying docker on AWS Beanstalk only serves html files, no other filesDocker PHP-APACHE container set the ServerName directive globallyUnable to open primary script (Permission denied)docker image for php is not working on browser for windows 10
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I tryied to run php:apache container. Then i apply the virtual host setting and exit the container bash and I used docker restart <containerid> but i couldn't start. Then i checked the logs with docker logs <containerid> and it says you have a syntax in 000-default.conf
Now that's my question: If i can't start the container how can i connect the container bash and open the 000-default.conf and fix the syntax error? Is there any other way for that?
Here is the log output:
C:UsersUtku>docker logs bb
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
[Sat Mar 23 01:05:26.411235 2019] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.25 (Debian) PHP/7.2.16 configured -- resuming normal operations
[Sat Mar 23 01:05:26.411274 2019] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
[Sat Mar 23 01:05:37.388586 2019] [autoindex:error] [pid 16] [client 172.17.0.1:40982] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
localhost:80 172.17.0.1 - - [23/Mar/2019:01:05:37 +0000] "GET / HTTP/1.1" 403 501 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
localhost:80 172.17.0.1 - - [23/Mar/2019:01:05:37 +0000] "GET /favicon.ico HTTP/1.1" 404 500 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
localhost:80 172.17.0.1 - - [23/Mar/2019:01:06:55 +0000] "GET / HTTP/1.1" 200 286 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
[Sat Mar 23 01:07:53.847828 2019] [mpm_prefork:notice] [pid 1] AH00169: caught SIGTERM, shutting down
AH00526: Syntax error on line 35 of /etc/apache2/sites-enabled/000-default.conf:
Invalid command 'sadasd', perhaps misspelled or defined by a module not included in the server configuration
docker
add a comment |
I tryied to run php:apache container. Then i apply the virtual host setting and exit the container bash and I used docker restart <containerid> but i couldn't start. Then i checked the logs with docker logs <containerid> and it says you have a syntax in 000-default.conf
Now that's my question: If i can't start the container how can i connect the container bash and open the 000-default.conf and fix the syntax error? Is there any other way for that?
Here is the log output:
C:UsersUtku>docker logs bb
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
[Sat Mar 23 01:05:26.411235 2019] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.25 (Debian) PHP/7.2.16 configured -- resuming normal operations
[Sat Mar 23 01:05:26.411274 2019] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
[Sat Mar 23 01:05:37.388586 2019] [autoindex:error] [pid 16] [client 172.17.0.1:40982] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
localhost:80 172.17.0.1 - - [23/Mar/2019:01:05:37 +0000] "GET / HTTP/1.1" 403 501 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
localhost:80 172.17.0.1 - - [23/Mar/2019:01:05:37 +0000] "GET /favicon.ico HTTP/1.1" 404 500 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
localhost:80 172.17.0.1 - - [23/Mar/2019:01:06:55 +0000] "GET / HTTP/1.1" 200 286 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
[Sat Mar 23 01:07:53.847828 2019] [mpm_prefork:notice] [pid 1] AH00169: caught SIGTERM, shutting down
AH00526: Syntax error on line 35 of /etc/apache2/sites-enabled/000-default.conf:
Invalid command 'sadasd', perhaps misspelled or defined by a module not included in the server configuration
docker
1
Possible duplicate of How do I edit a file after I shell to a Docker container?
– vfalcao
Mar 23 at 1:01
Please, post the exact error logged, in order to help us help you solve your problem.
– vfalcao
Mar 23 at 1:02
add a comment |
I tryied to run php:apache container. Then i apply the virtual host setting and exit the container bash and I used docker restart <containerid> but i couldn't start. Then i checked the logs with docker logs <containerid> and it says you have a syntax in 000-default.conf
Now that's my question: If i can't start the container how can i connect the container bash and open the 000-default.conf and fix the syntax error? Is there any other way for that?
Here is the log output:
C:UsersUtku>docker logs bb
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
[Sat Mar 23 01:05:26.411235 2019] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.25 (Debian) PHP/7.2.16 configured -- resuming normal operations
[Sat Mar 23 01:05:26.411274 2019] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
[Sat Mar 23 01:05:37.388586 2019] [autoindex:error] [pid 16] [client 172.17.0.1:40982] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
localhost:80 172.17.0.1 - - [23/Mar/2019:01:05:37 +0000] "GET / HTTP/1.1" 403 501 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
localhost:80 172.17.0.1 - - [23/Mar/2019:01:05:37 +0000] "GET /favicon.ico HTTP/1.1" 404 500 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
localhost:80 172.17.0.1 - - [23/Mar/2019:01:06:55 +0000] "GET / HTTP/1.1" 200 286 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
[Sat Mar 23 01:07:53.847828 2019] [mpm_prefork:notice] [pid 1] AH00169: caught SIGTERM, shutting down
AH00526: Syntax error on line 35 of /etc/apache2/sites-enabled/000-default.conf:
Invalid command 'sadasd', perhaps misspelled or defined by a module not included in the server configuration
docker
I tryied to run php:apache container. Then i apply the virtual host setting and exit the container bash and I used docker restart <containerid> but i couldn't start. Then i checked the logs with docker logs <containerid> and it says you have a syntax in 000-default.conf
Now that's my question: If i can't start the container how can i connect the container bash and open the 000-default.conf and fix the syntax error? Is there any other way for that?
Here is the log output:
C:UsersUtku>docker logs bb
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
[Sat Mar 23 01:05:26.411235 2019] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.25 (Debian) PHP/7.2.16 configured -- resuming normal operations
[Sat Mar 23 01:05:26.411274 2019] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
[Sat Mar 23 01:05:37.388586 2019] [autoindex:error] [pid 16] [client 172.17.0.1:40982] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
localhost:80 172.17.0.1 - - [23/Mar/2019:01:05:37 +0000] "GET / HTTP/1.1" 403 501 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
localhost:80 172.17.0.1 - - [23/Mar/2019:01:05:37 +0000] "GET /favicon.ico HTTP/1.1" 404 500 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
localhost:80 172.17.0.1 - - [23/Mar/2019:01:06:55 +0000] "GET / HTTP/1.1" 200 286 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
[Sat Mar 23 01:07:53.847828 2019] [mpm_prefork:notice] [pid 1] AH00169: caught SIGTERM, shutting down
AH00526: Syntax error on line 35 of /etc/apache2/sites-enabled/000-default.conf:
Invalid command 'sadasd', perhaps misspelled or defined by a module not included in the server configuration
docker
docker
edited Mar 23 at 1:09
Utku Altaş
asked Mar 23 at 0:54
Utku AltaşUtku Altaş
183
183
1
Possible duplicate of How do I edit a file after I shell to a Docker container?
– vfalcao
Mar 23 at 1:01
Please, post the exact error logged, in order to help us help you solve your problem.
– vfalcao
Mar 23 at 1:02
add a comment |
1
Possible duplicate of How do I edit a file after I shell to a Docker container?
– vfalcao
Mar 23 at 1:01
Please, post the exact error logged, in order to help us help you solve your problem.
– vfalcao
Mar 23 at 1:02
1
1
Possible duplicate of How do I edit a file after I shell to a Docker container?
– vfalcao
Mar 23 at 1:01
Possible duplicate of How do I edit a file after I shell to a Docker container?
– vfalcao
Mar 23 at 1:01
Please, post the exact error logged, in order to help us help you solve your problem.
– vfalcao
Mar 23 at 1:02
Please, post the exact error logged, in order to help us help you solve your problem.
– vfalcao
Mar 23 at 1:02
add a comment |
2 Answers
2
active
oldest
votes
EDIT: docker cp should also works on stopped container, you can copy the config file out of the container, edit it, and copy back.
Yes, but you need to create an image from this container and run it:
- use
docker ps -ato find the failed container's id, for example:d391b29f5526. - run
docker commit d391b29f5526 test-imageto create a image from this container. docker run -it --entrypoint bash test-imageand do your edit.- commit the container created from step 3 to an image and run it.
add a comment |
Try the following:
docker cp bb:/etc/apache2/sites-enabled/000-default.conf /tmp/000-default.conf
now, edit your /tmp/000-default.conf (on your docker host) and remove thissadasd on your line 35, as said in the log;
after editing, copy back the file to the container:
docker cp /tmp/000-default.conf bb:/etc/apache2/sites-enabled/000-default.conf
If your conf files are error free, now you should be able to restart your container.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55309575%2fhow-can-i-use-exec-for-contrainer-bash-when-the-container-wont-start-in-docker%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
EDIT: docker cp should also works on stopped container, you can copy the config file out of the container, edit it, and copy back.
Yes, but you need to create an image from this container and run it:
- use
docker ps -ato find the failed container's id, for example:d391b29f5526. - run
docker commit d391b29f5526 test-imageto create a image from this container. docker run -it --entrypoint bash test-imageand do your edit.- commit the container created from step 3 to an image and run it.
add a comment |
EDIT: docker cp should also works on stopped container, you can copy the config file out of the container, edit it, and copy back.
Yes, but you need to create an image from this container and run it:
- use
docker ps -ato find the failed container's id, for example:d391b29f5526. - run
docker commit d391b29f5526 test-imageto create a image from this container. docker run -it --entrypoint bash test-imageand do your edit.- commit the container created from step 3 to an image and run it.
add a comment |
EDIT: docker cp should also works on stopped container, you can copy the config file out of the container, edit it, and copy back.
Yes, but you need to create an image from this container and run it:
- use
docker ps -ato find the failed container's id, for example:d391b29f5526. - run
docker commit d391b29f5526 test-imageto create a image from this container. docker run -it --entrypoint bash test-imageand do your edit.- commit the container created from step 3 to an image and run it.
EDIT: docker cp should also works on stopped container, you can copy the config file out of the container, edit it, and copy back.
Yes, but you need to create an image from this container and run it:
- use
docker ps -ato find the failed container's id, for example:d391b29f5526. - run
docker commit d391b29f5526 test-imageto create a image from this container. docker run -it --entrypoint bash test-imageand do your edit.- commit the container created from step 3 to an image and run it.
edited Mar 23 at 1:34
answered Mar 23 at 1:06
tsl0922tsl0922
42736
42736
add a comment |
add a comment |
Try the following:
docker cp bb:/etc/apache2/sites-enabled/000-default.conf /tmp/000-default.conf
now, edit your /tmp/000-default.conf (on your docker host) and remove thissadasd on your line 35, as said in the log;
after editing, copy back the file to the container:
docker cp /tmp/000-default.conf bb:/etc/apache2/sites-enabled/000-default.conf
If your conf files are error free, now you should be able to restart your container.
add a comment |
Try the following:
docker cp bb:/etc/apache2/sites-enabled/000-default.conf /tmp/000-default.conf
now, edit your /tmp/000-default.conf (on your docker host) and remove thissadasd on your line 35, as said in the log;
after editing, copy back the file to the container:
docker cp /tmp/000-default.conf bb:/etc/apache2/sites-enabled/000-default.conf
If your conf files are error free, now you should be able to restart your container.
add a comment |
Try the following:
docker cp bb:/etc/apache2/sites-enabled/000-default.conf /tmp/000-default.conf
now, edit your /tmp/000-default.conf (on your docker host) and remove thissadasd on your line 35, as said in the log;
after editing, copy back the file to the container:
docker cp /tmp/000-default.conf bb:/etc/apache2/sites-enabled/000-default.conf
If your conf files are error free, now you should be able to restart your container.
Try the following:
docker cp bb:/etc/apache2/sites-enabled/000-default.conf /tmp/000-default.conf
now, edit your /tmp/000-default.conf (on your docker host) and remove thissadasd on your line 35, as said in the log;
after editing, copy back the file to the container:
docker cp /tmp/000-default.conf bb:/etc/apache2/sites-enabled/000-default.conf
If your conf files are error free, now you should be able to restart your container.
answered Mar 23 at 2:24
vfalcaovfalcao
136211
136211
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55309575%2fhow-can-i-use-exec-for-contrainer-bash-when-the-container-wont-start-in-docker%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Possible duplicate of How do I edit a file after I shell to a Docker container?
– vfalcao
Mar 23 at 1:01
Please, post the exact error logged, in order to help us help you solve your problem.
– vfalcao
Mar 23 at 1:02