Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

206
Views
SSH docker container issue after running Apache on Alpine

I have an issue in my SSH session with a docker container. Actually can't execute any command because of a running process that never gives me hand on the terminal, see output:

[Thu Apr 02 19:39:46.056749 2020] [mpm_prefork:notice] [pid 7] AH00163: Apache/2.4.43 (Unix) PHP/7.3.16 configured -- resuming normal operations
[Thu Apr 02 19:39:46.057465 2020] [core:notice] [pid 7] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

Dockerfile install Apache on Alpine and ends:

ENTRYPOINT [ "/opt/entrypoint.sh" ]

entrypoint.sh:

/usr/sbin/httpd -D FOREGROUND

Any hint how I can get my SSH session working and gives me hand to execute other commands? Thank you.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

The container paradigm does not promote usage of things like ssh servers. The core concept is that you are only hosting a single isolated process inside the container, in your case 'httpd'.

in other words, there is no ssh server running inside the apache container, it is only hosting the web server process.

You can use a command like docker exec <container_name> <command>, to execute another process in the same container. For example:

docker exec myhttpd ls -la

Which will list the content of the configured working directory in the container.

docker exec will connect the stdout and stderr in your current terminal session to the stdout and stderr of the container, and execute your command in the environment of the container.

This is a good solution for trouble shooting and trying things out. But look for alternatives if you are seeking to permanently change the environment of your contained application. Such as using the Dockerfile.

If you supply some more information about your usecase, I will be happy to make a suggestion.

over 4 years ago · Santiago Trujillo Report

0

Actually moving command from my dockerfile to the procfile provided by my hosting provider solved the issue. Dockerfile after this change:

FROM alpine
# install apache
# other installation requirements
EXPOSE 80
# commented the line below
# ENTRYPOINT ["/opt/entrypoint.sh"]

And moved the last instruction to Procfile. After this change the process will be a service published from my container and not an entrypoint that will be executed each time the image built or restarted.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!