Unable to change permissions inside AWS Docker ubuntu instance

I'm trying to run a discord bot in an AWS ubuntu docker container.

My Dockerfile looks like this:

FROM ubuntu
ADD hydrabot.exe /
ADD bot_config.json /
ADD client_secrets.json /
ADD Cyberbit.ttf /
ADD credentials.txt /
ADD performance.png /
CMD ["./hydrabot.exe"]

I've run;

cd /dockerfiledirectory
sudo chown 1001:1001 /dockerfiledirectory
docker build -t arbitraryname .

And now I'm trying to run: docker run -–restart=always arbitraryname

But I get the error;

docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "./hydrabot.exe": permission denied: unknown.

I've read a few stack topics and it indicates trying to set the local aws directory permissions to execute as they are currently; -rw-rw-r-- 1 ubuntu ubuntu 45612135 Jan 27 12:25 hydrabot.exe

I tried both chmod -x hydrabot.exe and sudo -x hydrabot.exe but neither change the permissions when I reinspect.

5

1 Answer

From the comments, combined with your question, you are attempting to run:

  • a Windows executable
  • ... inside an Ubuntu Docker image
  • ... inside an Ubuntu AWS EC2 instance.

This just isn't going to work. For starters, to run a Windows executable in Docker, regardless, you have to be using a Windows Docker image. You are attempting to use the Ubuntu image.

But even if you were to try to use something like the microsoft/windowsservercore image as a base, that wouldn't work on an Ubuntu EC2 instance. Docker is a containerization technology that requires that the base operating system be able to run the applications, since the kernel is shared between the host and the container.

Further, I'm worried. I could be wrong, but I have a feeling that the executable you are trying to run is malware. From my (admittedly quick) research, Hydra Bot is not distributed as an executable (neither Windows, nor Linux). It's a service provided through registration on their website, then inviting the bot to your Discord channel.

Again, I could be off base, but if I'm not -- Please confirm the source and be very cautious of attempting to run executables from untrusted sources.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like