0
votes

Im not going to lie im very new to docker and I need dockers help to get my selenium project to build and run in a container

this is my current dockerfile

# start with SDK  
FROM  mcr.microsoft.com/dotnet/core/sdk:3.1 AS build

# copy all server files/dependencies, target project dir & restore
COPY . .
WORKDIR /SA.myProject
RUN dotnet publish -c Release -o /app

# Install Google Chrome
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
RUN apt-get update && apt-get install -y google-chrome-stable
RUN apt-get install libxss1

#COPY --from=build /app .
WORKDIR /app
ENTRYPOINT ["dotnet", "test", "SA.myProject.dll"]

I get the error saying that "The chromedriver file does not exist in the current directory or in a directory on the PATH environment variable. The driver can be downloaded at http://chromedriver.storage.googleapis.com/index.html."

I have the chrome driver as a nuget package and the chromedriver application exists in the same directory as my dll file. Why isn't it able to find it?

Ive tried to also obtain the webdriver with the dockerfile similar to how I install chrome above but i guess my inexperience with docker didnt get me anywhere.

What am I missing here? I feel like ive been shooting in the dark for the last 2 weeks, any help or assistance/advice in the right direction will be greatly appreciated.

1

1 Answers

0
votes

I found the answer I downloaded chrome driver with the image above and just made sure it was downloaded into the correct folder