-
-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make docker run locally #3680
Make docker run locally #3680
Conversation
RUN mkdir -p Client Server Shared utils vendor | ||
|
||
COPY Client Client | ||
COPY Server Server | ||
COPY Shared Shared | ||
COPY utils utils | ||
COPY vendor vendor | ||
COPY ./* . | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use -v
parameter in docker run
to mount these folders into a container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would it work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should mount mta repository (or an empty folder) to /build
folder in a container. docker-entrypoint.sh
runs inside this folder.
# So, first make a shallow clone of the repository if it not exists | ||
umask 000 | ||
if [ ! -f ./premake5.lua ]; then | ||
git clone --depth=1 https://github.com/multitheftauto/mtasa-blue.git . | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? Nothing is wrong here. This line allows you to build MTA without cloning the MTA repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line actually clones the entire repo all the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't. Check your command line and current folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does. Docker pulls mta repo from github if that line is saved. Without it, it runs only local changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. I tested it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me too. It didnt accept local copy unless I remove that line.
If you try to build mta then you already have necessary files in your filesystem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cd <mta sa repo here>
docker build -t mtasabuilder:latest .
docker run --rm -v ./:/build mtasabuilder:latest
Does it work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"volume name is too short, names should be at least two alphanumeric characters."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docker run --rm -v <full path to repo>:/build mtasabuilder:latest
?
It works locally now docker build -t mtasabuilder:latest .
docker run --rm -v ./:/build mtasabuilder:latest |
Did you ever try the steps under Building with Docker from the README? Lines 113 to 122 in 550a152
|
I did, but no matter what I do I always get a copy of the github repo instead of my local one. |
Alright, but did you try using |
Do you use powershell in windows? |
Didn't try that exact method but when
Nope |
You're supposed to mount your local directory into the Docker container, and by poking around within a /bin/bash shell, you can see if your mount is actually working. If it's not there, then obviously the docker-entrypoint.sh script is going to clone the repository everytime. |
Invalid / a system issue |
This PR localizes Docker. It no longer copies mtasa repo but local copy of the mta.