1

Dockerfile:

FROM golang:latest # COPY kube/command.sh . RUN apt-get update # To be able to do go run !(*_test).go RUN apt-get install dnsutils -y # CMD [ "shopt -s extglob" ] CMD [ "sh command.sh" ] # RUN bash -c shopt -s extglob # RUN "sh command.sh" 

Also tried with a script file(command.sh):

#!/bin/sh shopt -s extglob 

And RUN bash -c shopt -s extglob

Building Dockerfile I get this:

bash: !: event not found 

If I run the container and manually doing shopt -s extglob: it works.

Do you know why?

1 Answer 1

1

Try this may help:

FROM golang:latest RUN apt-get update # To be able to do go run !(*_test).go RUN apt-get install dnsutils -y # COPY kube/command.sh . COPY commands.sh /scripts/commands.sh RUN ["chmod", "+x", "/scripts/commands.sh"] ENTRYPOINT ["/scripts/commands.sh"] 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.