Jan Carlo Viray Angular. React. Node. DevOps.

How to update all Docker images

Currently, Docker does not have a command to do this so we will have to do some good old fashioned command piping. To automatically update all images:

docker images | grep -v REPOSITORY | awk '{print $1}' | xargs -L1 docker pull

Docker does not overwrite old images for us. To cleanup old images:

docker images | grep "<none>" | awk '{print $3}' | xargs -L1 docker rmi

Note that you must wait for the update process to finish. Here’s a summary of what each command does…

Read More

Common Linux Commands

Here are some of the more common linux commands I use when managing files and services in a unix environment. Here’s a mind-map overview if you’re into that. Expand this blog topic if you’d like to see the text version or read more. Linux Commands

Read More

Companies Using Docker

Going with the flow of “companies using [insert tech]”, here are the companies using Docker. Big companies with the need for scalable and distributed systems seem to have adopted docker. Though there are many critics talking about Docker not being production-ready, I am impressed to find that a global financial service corportation such as ING using Docker containers to drive 500 deployments a week. In addition, Goldman Sachs, a global investment bank uses Docker containers to centralize application builds and deployments. For all the critics out there, here’s a myth busting article revolving around Docker’s supposed “flaws”. Check out the list below as well.

Read More

Companies Using Angular

To be fair, it would be nice to see my other favorite stack have an updated list of companies using it. Here’s the list of companies using AngularJS, in order of recently found to older

Read More

Companies Using React

I am quite impressed at the adoption of React.js (it is not 1.0 yet!). From my search and experience working with both Angular and React, as well as networking within the field, I personally see that (with exceptions) Angular.js is the de-facto framework chosen by early startups while React.js is the de-facto framework chosen by more established companies/startups. Personally, I love both. I find Angular.js more fun to work with (at the cost of occasional frustrations), while I find React.js more peaceful and less stressful framework to work with, though at the cost of more typing and boilerplate code to write

Read More

React Props in State an Anti-Pattern

Passing the initial state to a component as a prop is an anti-pattern because the getInitialState method is only called the first time the component renders - and never called after that. This means that if you re-render the parent, while passing a different value as a prop, the component will not update the UI because it will keep the state from the first time it was rendered. This will make the application very prone to errors.

Read More

React.js Lessons Learned

React.js lessons learned and some opinionated best practices. This is an ongoing compilation and in-progress work of everything I have learned from developing in React.js

Read More

React Best Practice Compilation

Here is a compilation of best practices I have learned and compiled building React.js applications. Feel free to add to this content by visiting my blog source and sending a pull request.

Read More

How to share/sync directory inside Vagrant

To share directories, add this to your config. config.vm.synced_folder "host/relative/path", "/guest/absolute/path". Below is an example within a full configuration file.

Read More

How to install Vagrant and VirtualBox

Vagrant provides easy to configure, reproducible, and portable work environments controlled by a single consistent workflow to help maximize the productivity and flexibility of you and your team. If you’re a developer, Vagrant will isolate dependencies and their configuration within a single disposable, consistent environment, without sacrificing any of the tools you’re used to working with (editors, browsers, debuggers, etc.). Once you or someone else creates a single Vagrantfile, you just need to vagrant up and everything is installed and configured for you to work. To get started, download Vagrant and VirtualBox.

Read More

State is an Anti-Pattern

As much as possible, do not use state at all. According to this comment, state should never have been in the library in the first place. It seems that if Flux was introduced in conjunction with React initially, state would not even exist. It seems that state was used to allow react to function by itself without flux. If a React component must have side-effects, it must use Flux actions instead of having state. Components ideally should have no state at all.

Read More

New Portfolio Site

I finally put my portfolio site at jcviray.com. I’m currently available for freelance/remote work and I specialize in Angular, React, Node, Mobile, Responsive. Let’s connect at linkedin! Also, let’s connect at twitter.

Read More

How To Reduce Docker Image Size?

Docker containers built from Dockerfiles can grow very big in size. There are a few simple tricks to cut back on some of the container fat. Here are some of the ones I’ve used. ## Clean the APT RUN apt-get clean RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ## Flatten the Image ID=$(docker run -d image-name /bin/bash) docker export $ID | docker import – flat-image-name Then, you can save it for backup too. ID=$(docker run -d image-name /bin/bash) (docker export $ID | gzip -c > image.tgz) gzip -dc image.tgz | docker import - flat-image-name

Read More

What Does Docker Link Do?

How does Docker link container? What happens during the process? Docker creates a secure tunnel between the containers that doesn’t need to expose any ports externally on the container. Notice that there is no need to use either the -P or -p flags.

Read More

Docker Commands Cheat Sheet

A summary of commands I have come across while using Docker in my projects.

Read More

Docker Run

What happens in a docker run command?

Read More

ReactJS Overview

One unique selling points is that ReactJS can also be rendered server side and can work with client/server inter-operably.

Read More

Basic Docker Overview

Docker is a growing technology for and spreading like wildfire. Time to delve in the basics and apply it on your projects!

Read More

Disable Terminal Line Wrap

I’ve gotten a bit annoyed with terminal wrapping long lines. I’ve been using less for a long time already, but did not know the -S option, or “–chop-long-lines”.

Read More

Run Terminal in Docker

docker run -i -t ubuntu:latest /bin/bash

Read More