How can I update Git Code into a Docker container directly

0 votes

Hi all, with regard to the above question - I need some basic help. My requirement is that I am trying to put in some Django code into a Docker container. 

This is the Docker file, check it out:

FROM ubuntu:latest
MAINTAINER { myname }

#RUN echo "deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -sc) main universe" >> /etc/apt/sou$

RUN apt-get update

RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tar git curl dialog wget net-tools nano buil$
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python python-dev python-distribute python-p$

RUN mkdir /opt/app
WORKDIR /opt/app

#Pull Code
RUN git clone git@bitbucket.org/{user}/{repo}

RUN pip install -r website/requirements.txt

#EXPOSE = ["8000"]
CMD python website/manage.py runserver 0.0.0.0:8000

So, after this I go about to build the code using the regular build command which is:

docker build -t dockerhubaccount/Edureka:v1 

And I know what this does. It basically pulls all the code from the repository which is Bitbucket in this scenario and put it to the container, correct?

Later after the build process is done, I run the code using the following syntax:

docker run -p 8000:8080 -td Anirudh/Edureka:v1

After this, things run fine as usual. But, since I used git clone I have this tiny ambiguity in my head.

There are the basic questions I have:

1. In your opinion, what is the fest workflow recommended for this kind of usage?

2. Is it possible to update the code (how?) when I make new commits and build it by storing in the container?

All help appreciated!

Jan 22, 2019 in Python by Anirudh
• 2,090 points
1,745 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Python

0 votes
1 answer

How can I convert a list of dictionaries from a CSV into a JSON object in Python?

You could try using the AST module. ...READ MORE

answered Apr 17, 2018 in Python by anonymous
3,413 views
0 votes
1 answer

How can I turn an input date into a readable string in Python?

The datetime class has a method strftime. strftime() ...READ MORE

answered Dec 11, 2018 in Python by aryya
• 7,460 points
601 views
0 votes
1 answer

How can I return HTTP status code 204 from a Django view?

Hello, Try this: return HttpResponse(status=204) Hope it works!! ...READ MORE

answered Aug 17, 2020 in Python by Niroj
• 82,880 points
7,048 views
+3 votes
7 answers

How can I rename a file in Python?

yes, you can use "os.rename" for that. ...READ MORE

answered Mar 31, 2018 in Python by DareDev
• 6,890 points
19,884 views
+2 votes
2 answers

How can I create a new file in Python?

You can try the below code which ...READ MORE

answered Mar 31, 2018 in Python by anto.trigg4
• 3,440 points
1,213 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,100 points
2,657 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP