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

425
Views
¿Cómo escribir un script bash que automatice el ingreso al "contenedor acoplable" y haga otras cosas?

Quiero implementar un script bash automático que ingrese a un docker container en ejecución y haga algunas cosas:

 # cat docker.sh #!/bin/bash -x docker exec -it hammerdb_net8 bash cd /data/oracle/tablespaces/ pwd

Ejecutando el script en la terminal:

 # ./docker.sh + docker exec -it hammerdb_net8 bash [root@npar1 /]#

El resultado muestra solo iniciar sesión en el docker container , pero no realizará otras operaciones.

¿Hay algún método para automatizar el ingreso al docker container y hacer otras cosas?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Puedes usar bash -c :

 docker exec -it hammerdb_net8 bash -c 'cd /data/oracle/tablespaces/; pwd; ls'

Para ejecutar una serie de comandos, use here-doc en BASH :

 docker exec -i hammerdb_net8 bash <<'EOF' cd /data/oracle/tablespaces/ pwd ls EOF
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!