In this post, basically, I don’t put options. If you think this command is lacking something important, you will need to check Docker Doc(https://docs.docker.com/)
pull command is almost same as git pull. Get an image to local from Docker hub.
$ docker pull kojikno/conda_docker
push command is also the same as git push. This command uploads your Docker image to Docker Hub. This allows others to use your image or you can use the image from any machines. For example, you can use the image for CI. I’m using my own image for Circle CI to run the test. The free plan allows us to have one private repo. You can make your image secure. The following: python3.7 is a tag. Generally, a community organization provides multiple versions of images.
This command shows you images you have. I think I have used this command so many times lol
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
arm64v8/ubuntu latest 56c6cce7dd32 7 days ago 57.7MB
circleci/picard latest 7d0931871af3 2 weeks ago 103MB
arm64v8/node 10.16.0-stretch 3583429b1ae9 3 weeks ago 853MB
rwmodel/runway/densedepth cpu 186943877dd5 8 weeks ago 1.85GB
This command is to remove an images. Sometimes images are huge, so need to delete images especially when I create an image from container which is based on an image from Docker Hub.
$ docker rmi image_id/image_name
$ docker rmi $(docker images -q --filter "dangling=true") <-- remove images which is named none
This command creates a container but doesn’t start a container.
ps could be your best friend when you use Docker. This command shows you running containers’ information. If you want to see stopped containers, you can add -a.
$ docker ps
$ docker ps -a
This command allows us to create an image from a container. We can pull an image and add/install anything we need then do commit. After that, we can start run/create a container the image we committed. One thing you should know is that commit creates a new image from the image you pulled and the size of the new one could be bigger than the based one. So, you need care about your storage if you don’t have enough storage on your machine.
$ docker commit container_id iamge_name:tag
This command is to start running a container.
$ docker start container_id/container_name
This command is to stop a running container.
$ docker stop container_id/container_name
When you are in Docker container, you can use exit to get out there.
This command to attach local standard input, output, and error streams to a running container.
$ docker attach container_id/container_name
This command deletes a container which is not running. You can remove multiple containers if you put multiple container_ids
$ docker rm container_id/container_name
# This commands remove all exited containers.
$ docker rm $(docker ps -qa --no-trunc --filter "status=exited")
This command is to remove unused data. If you really want to clean up your Docker environment, you can use -aoption. However, this option removes all unused data so be careful when you use this option.
$ docker system prune OPTIONS
This command allows us to exec another process in a running container.
$ docker exec option container_id/container_name
Actually, there are so many commands you can use/should know, but I guess for a beginner like me these commands are kind of enough to learn the basics of Docker.
Hope this is useful for someone!
If something wrong or missing something important, please leave a comment!!!(I’m still learning Docker ?)
If you don’t like to use CLI, you can use Docker with GUI like kitematic(https://kitematic.com/), but probably CLI could be helpful to understand Docker since we will need to write Dockerfile, docker-compose.yml.
Third-party frameworks and libraries are (and will probably continue to be) a topic for heated debate. Some developers spend more time researching and evaluating a potential framework than they do developing stuff with it, some developers reach for new libraries as soon as they run into a problem. This article takes a look at some pros and cons of using third-party libraries and frameworks.
Framework vs Library
First off, let’s start with a few words on what constitutes a framework or a library. The Internet is full of different definitions, some of them argue that the application of the Inversion of Control Principle is the main difference between the two, while some argue that a library is a collection of task-specific methods and a framework is a broad, ill-defined term that could be equal to a library, be a collection of libraries or something much more involved. For this article, the only thing we need to agree on is that both a library and a framework are collections of methods with the purpose of speeding up development and abstracting away common or complex calculations.
Let’s start by looking at what advantages a framework / library can bring to our project if used correctly.
Prototyping If you’re doing a quick proof of concept and want to show that your idea is feasible rather than build a production grade application, a framework might be able get you up and running faster than if you were to write all the code yourself. If you manage to get others onboard and secure funding to take the idea to market, you can decide whether you’d like to keep the dependency or whether you’d like to develop your own, custom made solution.
Faster Development A framework could come in handy if an application requires a huge amount of work just to lay the invisible foundation for anything tangible. Let’s say that you’re developing an application that displays a lot of different data using graphs. It may take developers quite some time to develop the code that display the different graphs, so you may choose to use a third-party framework to reduce the time it takes to show anything at all. This can be a competence and/or financial resources call as well. When implementing a service that relies on maps to display information to users, it probably makes much more sense to use an established maps SDK than to hire an entire department to create your own maps.
Tested And Refined Code This one is only true in an ideal world, because the truth is that far from all libraries and frameworks that are available are updated / iterated on / supported in a timely manner. If a library has a steady user base and has been around for some time, chances are that it has been refined a couple of times. Bugs will have been reported, and a lot of them have hopefully been ironed out in recent versions. This is ultimately a judgement call, and it is one that should not be taken lightly when choosing whether or not to go with a framework.
The cons of using any frameworks or libraries can pretty much be summarized using a single word: Risk. All external dependencies come at the cost of taking risks, and this is something that should be thoroughly considered before choosing whether or not to go with a framework for a production grade application.
Lack Of Support We touched briefly on this is the advantages section, but from the perspective of using tested and matured code. On the other end of the spectrum, we find frameworks and libraries that are abandoned by their authors, and therefore don’t receive proper updates when languages evolve and weaknesses are found. You could end up building your application around a framework that will ultimately keep you from properly maintaining it, and that could cost you a ton of hours to replace it at a later time.
Major API Changes Since you don’t control the framework, you also don’t control the changes that are made to the API. You may end up in a situation where you need to migrate to a newer language version (especially true in the Swift world, where I reside most of the time). The authors of the framework may think that the breakpoint between the two language versions is a perfect time to make some bigger, breaking changes to the API, and you will end up having to repair your interactions with the framework on top of the migration. Not fun!
Application Size Whenever you’re using a framework, your application will add on the size of that dependency, even though you may only use a fraction of the functionality. This is even more important for developers who have a tendency to reach for libraries and frameworks whenever they feel a bit lazy or don’t want to spend a little bit of time thinking about how to solve a problem.
So, Do You Really Need That Framework?
This is ultimately a judgement call (of course), and it varies between situations. However, I personally feel like a lot of developers reach for libraries way too fast, before they’ve actually considered if they really need it.
To me, the best way of deciding is to start out in the “I don’t need this dependency” camp, and try to convince myself that it will actually be worth it in the end. This can be done by pointing to savings in time and/or costs, or the fact that I may not have the competence to create and/or maintain the functionality.
Note that “may not have the competence” should not be viewed as an easy out by saying “I can’t think of a way to do this right now, I’m gonna use that framework”. There’s a difference between skills I can learn with a few Google searches, and skills that require deep knowledge of a topic, knowledge that takes months or years of studies to acquire. Don’t let laziness make these decisions for you.
Predicting what programming technologies will emerge in 2020
2020 is almost here, as crazy as that sounds. The year 2020 sounds like it’s derived from science fiction, yet here we are — about to knock on its front door.
If you’re curious about what the future might bring to the programming world, you’re in the right place. I might be completely wrong — don’t quote me on this— but here’s what I think will happen. I can’t predict the future, but I can make educated guesses.
“The best way to predict your future is to create it.”
― Abraham Lincoln
Rust Will Become Mainstream
Rustis a multi-paradigm system programming language focused on safety — especially safe concurrency. Rust is syntactically similar to C++, but it’s designed to provide better memory safety while maintaining high performance.
We’ve seen four years of strong growth of the Rust programming language. I believe 2020 is the year Rust will officially become mainstream. What is mainstream is up for self-interpretation, but I believe schools will start introducing Rust to their curriculum. This will create a new wave of Rust engineers.
Rust has proven itself to be a great language with a vibrant and active community. With Facebook building Libra on Rust — its the biggest project ever — we’re about to see what Rust is really made off.
As our applications grow in complexity, so do our data consumption needs. I’m a big fan of GraphQL, and I’ve used it many times. I think it’s a far superior solution to fetching data compared with a traditional REST API.
While typical REST APIs require loading from multiple URLs, GraphQL APIs get all the data your app needs in a single request.
GraphQL is used by teams of all sizes in many different environments and languages to power mobile apps, websites, and APIs.
Progressive Web Apps (PWA) is a new approach to building applications by combining the best features of the web with the top qualities of mobile apps.
There are way more web developers in the wild than native platform-specific developers. Once big companies realize that they can repurpose their web devs to make progressive web applications, I suspect that we’ll be seeing a huge wave of PWAs.
It will take a while for bigger companies to adapt, though, which is pretty normal for technology. The progressive part would generally fall towards the front end development since it’s mostly all about interacting with the Web Workers API (Native Browser API).
Web apps aren’t going anywhere. More people are catching onto the idea that writing a single cross-compatible PWA is less work and more money for your time.
Today is a perfect day to start learning more about PWAs, start here.
Web Assembly Will See More Light
WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable target for compilation of high-level languages like C, C++, and Rust. Wasm also enables deployment on the web for client and server applications. PWAs can use wasm too.
Performance is key, and as the amount of data grows, it will be even harder to keep a good performance. That’s when low-level libraries from C++ or Rust come into play. We’ll see bigger companies adopting Web Assembly and snowball from there.