Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

149
Visualizações
Do something using Dockerfile RUN but ignore errors

I think I want to have Docker RUN something which I know will fail, but then use a repair to fix it up, i.e.

RUN dpkg -i wkhtmltox_0.12.6-1.focal_arm64.deb
RUN apt-get update
RUN apt fix-broken install

It seems that apt recognises that wkhtmltox failed to install due to missing packages and is then able to install them all. ...I think.

Anyway, even trying this means allowing the Docker build to continue upon a bad exit code.

Can I do that?

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Here is the solution:

RUN dpkg -i wkhtmltox_0.12.6-1.focal_arm64.deb || true
RUN apt-get update || true
RUN apt fix-broken install || true
over 4 years ago · Santiago Trujillo Relatório

0

You may really want a few improvements in addition to just getting this working!

  • verify dpkg successfully brought in the package
  • use apt-get instead of apt to avoid the stable interface warning
  • run all your apt commands in the same block with clean at the end to reduce container size
# NOTE dpkg -i exits nonzero due to missing dependencies
RUN dpkg -i wkhtmltox_0.12.6-1.focal_arm64.deb ; \
    dpkg -l | grep wkhtmltox
RUN apt-get update && \
    apt-get -f install && \
    apt-get clean
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda