Complete beginner - HELP!

Hi there

I have recently began on my journey towards (hopefully) becoming a software developer. I am currently at the early stage of trying to set up my first Docker Image and Container. I have set up my Docker account but the book I am reading has asked me to “Create a directory in my home directory (or wherever I can easily find it)”. Inside that directory I must create a file called Dockerfile.

I am sure this is a very basic silly question, but can anyone explain what this means in simple terms and I cannot work it out, thus am prevented from moving forward.

Many thanks.

Please help us to understand what exactly it is you find unclear.
Is it creating the directory? Or creating a new text file and saving it inside that created directory using the name Dockerfile?

Hi there

Thanks for your reply.

Please excuse the clumsy language, brand new to anything software development!

I have created a Repository, on Docker. Now I need to “Create a directory in my home directory” then, in that directory I need to create a file called Dockerfile.

The book then goes on to say that "this file does not have a file extension. It is just called Dockerfile. If you are using Sublime you should be able to create your Dockerfile using Sublime. Add these three lines into your Dockerfile:

FROM python: 3.7.5-slim
RUN python -m pip install DateTime
RUN apt update && apt -y install vim

I assume things will become more obvious when I understand how to make a directory in my home directory and know how to create a file called Dockerfile.

Thanks again. I look forward to your thoughts.

Nick

I can see why it’s not explained in the book, as it is basic knowledge about your operating system.

I could google those things for you, but I trust you are able to goole for “how to create a directory mac” and “how to create a text file mac” on your own.

Goodness, is it that simple! Thank you kindly.

Me again, cap in hand!

So, the book says the following:

Make sure you are in the directory where the Dockerfile is located. Run the following command in the shell:

docker build -t y username (I used my actual username here of course)/python-docker-tutorial:v1.0.0.

To verify that you have tagged the image, use the following command in your shell:

docker images

Therefore, I created a text file in a desktop file (which I think is classed as a directory). I then did as the book requested and wrote this in the text file:

FROM python: 3.7.5-slim
RUN python -m pip install DateTime
RUN apt update && apt -y install vim

I then opened the mac Terminal (which I believe is a “shell”)

I then did as the book requested and wrote the following in the Terminal (whilst also having the Directory open):

docker build -t y username (I used my actual username here of course)/python-docker-tutorial:v1.0.0.

However, the Terminal did not give me what the book said it would, instead I got:

-bash: docker: command not found

Nicolass-MBP:~ nicolashancock$

Again, I am sure there is a simple explanation for this and I thank you in advance for your consideration.

Why would you expect the docker command to be available on your system?
What did you do to make the command available?

I am that new to this that I did not expect anything. I just did what I thought the book said to do, as outlined in my previous question submission.

I opened the Mac “terminal” through the Launch Pad. I am guessing this is incorrect?

Some rules to follow in order to become a software developer:

  • Learn to use Google to search for what you want to use
  • Always look for official documentations
  • When you find a tutorial which doesn’t include the installation process, search for it on Google and in the documentation
  • If you ask on a forum, don’t create a topic with a title “Complete beginner - HELP!”, because many of us will not even look into the topic. It would be really hard to find anything on a forum where everyone’s topic is “HELP” :slight_smile: Describe your issue in the title.
  • Always share your sources (link to the tutorial, read part of the documentation) and use code block: How to format your forum posts

Now if you installed Docker on your Mac, please share how (link please). If you haven’t installed it yet, follow the above instructions to find the documentation. If you can’t, I will still help you, but I’m sure you will find it in no time :slight_smile:

1 Like

Most of your questions are not really about software development. You’re asking basic computer operation/use questions. What is your background in using a computer?

You have managed to find the docker forums and register for an account so I assume you should have some basic knowledge of computers.

My suggestion is take your time and think about what the book is saying.

Hi

Rimelek, thank you for the list of suggestions. I will bear these in mind moving forward.

In response:

  • Learn to use Google to search for what you want to use
    I do use Google, but as this is tantamount to a new language to me, finding the correct terms to search with and then interpreting the responses has been a challenge, hence why I reached out to humans. However, like learning a new language, I envisage this getting easier the more I learn the fundamentals.

  • Always look for official documentations
    I will certainly try, although I am not sure which official documents are the best to use. But, I will pay more attention to this.

  • When you find a tutorial which doesn’t include the installation process, search for it on Google and in the documentation
    Please see above. I am so new to this that I am not even able to tell what parts relate to the need for installation and which do not. But, I appreciate now that if the book does not guide on something that it just expects, then it is probably installation based, rather than software development per se.

  • If you ask on a forum, don’t create a topic with a title “Complete beginner - HELP!”, because many of us will not even look into the topic. It would be really hard to find anything on a forum where everyone’s topic is “HELP” :slight_smile:Describe your issue in the title.
    Valid point.

  • Always share your sources (link to the tutorial, read part of the documentation) and use code block: https://forums.docker.com/t/how-to-format-your-forum-posts/127295
    Very useful, thank you!

Fatdollar, yes, this is becoming apparent. As silly as it sounds, at the moment I am not able to tell which parts are software development and which bits are operation/user questions. Believe it or not, I have an undergraduate degree (physiotherapy) and a Masters (MBA) and opened, grew and sold a company which had over 50 staff, for which I was the person who solved any typical computer issues, of which there were many, so I am actually very familiar with computers. But, it is becoming evident that software development is very different to anything that I have done before. But, given my background, I know I will move forward quickly, but the beginnings need to be grasped first to provide a foundation upon which to develop.

At your obviously advanced stage, you may now appreciate just how much knowledge you have that you take for granted. I like the analogy of learning a new language. Like learning a new language, software development is impossible before learning the very basics that are so basic that they are taken for granted for aficionados such as yourself I would suspect.

Anyway, thanks for your input. I really appreciate it.

Yes. And a part of it is always reading the official documentations to learn more about the concept and the specific software.

“documentation”, not just documents. You open Google and search for “docker documentation” and that will be the first result: https://docs.docker.com/
There are different categories in the docs, but all of them is useful to read. You can also use the sarch feature if you are searching for something specific.

I have tutorials too. I made a website on which I also refer to the documentation but I have examples from the easiest to the more complex. You can find the sourcecode on GitHub, but I also share everything directly in the descriptions, so it is usually just copy-paste but most of the commands require Linux or macOS hosts. I also explain the difference between Docker CE and Docker Desktop, so start from the beginning, not from the examples.

I don’t cover the installation process since Docker is supported on many platforms and and the installation is different too, you will find links to the documentation for the installation.

On macOS, you will need Docker Desktop. I also have videos about that (using an older version so there could be differences): https://www.youtube.com/watch?v=l_Hspk2hMPo

Rimelek, thank you for this. I am going to get to it.