Buscar

Javier Caceres – jacace

Javier's blog about C#, Software Architecture and Design

My presentation in the Azure Dublin meetup about Azure Container Services, Docker Swarm and DC/OS

 

Back in July I presented the session “Debugging Containers and running clusters in ACS with DC/OS or Swarm” in the Azure Dublin meetup held in the NDRC:

Debugging Containers and running clusters in ACS with DC/OS or Swarm

Wednesday, Jul 13, 2016, 5:30 PM

Location details are available to members only.

47 Azurees Went

Hi all! Thanks to everyone who attended Decoded back in the beginning of May. It was a great few days and I hope those of you who joined us enjoyed it.Since the event, Javier Caceres has approached us with some good follow up content that he’d like to share with this community. Below is a short description and a bit of background on Javier.Event …

Check out this Meetup →

During this presentation I explained the basic concepts of Azure Container Services, Mesosphere and I even built a container using the nginx image and a ASP.NET Core app.

For some reason I forgot to share this presentation before, but no worries, I remembered this today and uploaded to my YouTube channel. Enjoy!

Javier Andrés Cáceres Alvis

Microsoft Most Valuable Professional – MVP

Intel Black Belt Software Developer

 

 

Using Eclipse Neon 4.6.1 and the Docker Tools plug-in 2.1

Previously I reviewed the Docker Tools plug-in version 1.0 running on Eclipse Mars 4.5: https://jacace.wordpress.com/2016/03/25/connecting-eclipse-on-windows-to-remote-docker-daemon/. Today I updated the review to use the newer Eclipse Neon 4.6.1 and the Docker Tools 2.1. I didn’t find any specific update of the plugin v2.x for Eclipse Oxygen 4.7

The core functionality hasn’t changed much, there are only two brand new capabilities: one to connect with the container shell/terminal and another one to “Open Image Hierarchy”, plus more than 50 bug fixes. To install this plug-in simply go to Help > Eclipse Marketplace > and enter docker and you will get the following results.

0-install-plugin

Select the option “Eclipse Docker Tooling 2.1.0”. Once installed, you need to establish a new connection with a Docker host. You will also need to bind your daemon to the host IP/port using the following command (note: the switch -d is only supported in version 1.9 and older versions): docker -H IP_ADDRESS:PORT -d &

[note: I also installed the Docker Editor provided by Open Analytics but is quite basic at the moment. It only does syntax highlighting and is not signed so you will get the warning seen below ]

1-install-editor

The version 2.1 of the plug-in shows the settings and properties of the Docker host as seen below.

2-connection_prop3-connection_info

From this version you can also run/tag/push/pull an image and setup a new connection to a docker registry as seen below:

The run new container window hasn’t changed considerably since last version, so you can still specify the image name, environment variables, etc as seen below:

6-run-image

More info here.

Enjoy!

Javier Andrés Cáceres Alvis

Microsoft Most Valuable Professional – MVP

Intel Black Belt Software Developer

How to squash a docker image?

Docker images tend to become bigger very quickly.

You can reduce the image size squashing the image. There are several utilities to squash an image, we will use https://github.com/jwilder/docker-squash

Use the following commands to download and extract the utility:
wget https://github.com/jwilder/docker-squash/releases/download/v0.2.0/docker-squash-linux-amd64-v0.2.0.tar.gz

sudo tar -C /usr/local/bin -xzvf docker-squash-linux-amd64-v0.2.0.tar.gz

One you have copied docker-squash you can piping your commands as described below (note that you can fork any shell command after the docker load):

docker save 75e2c7769b | ./docker-squash -from root -t repositoryId | docker load & <your_forked_command>

All parameters are self explanatory except -from root. If you don’t use this parameter the base image (FROM statement) is kept separately as seen in the circle pointed by the first arrow in the image below. If you use it then the FROM statement is also squashed as seen in the circle pointed by the second arrow.

squash_img

Note that Image IDs are different/unique even though they’re both based on the same image.

Javier Andrés Cáceres Alvis

Microsoft Most Valuable Professional – MVP

Intel Black Belt Software Developer

How to clean up dangling / intermediate Docker images?

An intermediate image is an image with the tag <none>:<none>, which means that they’re untagged images but they’re still tracked by Docker. They are created when the first image layer is downloaded/pulled during a docker pull. You can see them with the command: docker images -a

Some of these intermediate images are not used, which means they’re dangling images which eats up disk space in your docker host. Images might still exist even if the container is in exited state.

Use the following commands to prune/clean-up docker images and containers in your docker host:

  • Command to stop all running containers
    • docker stop $(docker ps -a -q)
  • Command to delete all containers
    • docker rm $(docker ps -a -q)
  • Command to specifically delete exited containers
    • docker rm ‘docker ps -aq –no-trunc –filter “status=exited”‘
  • Command to remove dangling images:
    • docker rmi ‘docker images –filter ‘dangling=true’ -q –no-trunc’
  • Command to delete all images
    • docker rmi $(docker images -q)
  • Starting with docker 1.13 (Sept 2016) you can use the command “docker system prune” which cleans the stopped containers, empty volumes and orphan images.

For more information check: http://www.projectatomic.io/blog/2015/07/what-are-docker-none-none-images/

Regards,
Javier Andrés Cáceres Alvis

Microsoft Most Valuable Professional – MVP

Intel Black Belt Software Developer

Docker Global Mentor Week 2016 – Dublin

I just signed up to present  a dev topic to other community members interested in using Docker as promised previously:

This means that I will be presenting how to develop/debug web apps in the .Net Core / Visual Studio / C# for Docker and how to run Docker Swarm in Azure.

When? Thursday, November 17, 2016 6:30 PM to 8:30 PM

Where? Kings Building, May Lane, Smithfield, Dublin 1, Dublin, Dublin

What? Docker Global Mentor Week Meetup

More information in the link below:

Docker Global Mentor Week Meetup

Thursday, Nov 17, 2016, 6:30 PM

Workday
Kings Building, May Lane, Smithfield, Dublin 1, Dublin Dublin, IE

96 Dockers Attending

Hi All,For our next meetup we’ll return to Workday for Global Mentor Week. Whether you are a mentor who would like to give a brief presentation on a topic close to your heart or someone who is interested in learning, we’ll have something interesting for you.Please confirm in the RSVP whether you can provide mentorship and whether you have a topic…

Check out this Meetup →

More info on this global initiative here.

Cheers,

Javier Andrés Cáceres Alvis

Microsoft Most Valuable Professional – MVP

Intel Black Belt Software Developer

 

Free .NET training in Dublin

I want to share the following info for people wanting to learn something new about Web Development in ASP.NET:
What? A free session titled “Introduction, about Tools and Frameworks”
When? Wednesday, October 26, 2016 – 6:30 PM
Where? Connaught House, 2nd floor, Burlington Rd, Dublin 4, Dublin (map)
This is brought to you by my Microsoft MVP colleague @hhrvoje

How to use GitLFS?

GitLFS is a good option for storing blobs such as binaries or any large non-source code artifact. This blog post shows you how to use GitLFS.

If you haven’t installed GitLFS just yet, then you need to install it first by entering the line below: git lfs install . Also, if haven’t created a git repo then you need to run the command git init.

If you already have a remote git repo then you can simply clone it using the well known command git clone <git_server_url>.

You need to configure your GitLFS server. Edit the git config file by adding the following sections:

[lfs]

url=”<git_lfs_server_url>”

[lfs <git_lfs_server_url>]

access=basic

Also add the following gitlfs config file:

[lfs]

url=”<git_lfs_server_url>”

Then the most important part is tracking the files you wish to store in the GitLFS server. A GitLFS server can be the same git server or a separate / dedicated server. To achieve this you can enter git lfs track “*.<file_extension>”

The next steps are straight forward, you simply run the usual commands git add <file_or_directory_path>, git commit -m “<commit_description>” and git push -u origin all. This works behind the scenes during git pull / push, so if you check your GitLFS server afterwards you will notice that the git server will only store pointers to the actual file in GitLFS server.

If you’re using a self-signed certificate on your GitLFS server then you might need to run the following line too: git config –global –add http.sslVerify false .

I hope this saves you sometime in your next gitlfs related endeavor.

[ Update 10Oct2016: if you get the error “Your local changes to the following files would be overwritten by merge”, you will need to do the following -more info here-]

git checkout HEAD^<file_to_overwrite>

git pull -f

[ Update 10Oct2016: don’t forget to create a dev branch and merge it once your binaries have been pushed into the repo –more info here-]
git checkout -b dev_branch

git checkout master

git merge dev_branch

Javier Andrés Cáceres Alvis

Microsoft Most Valuable Professional – MVP

Intel Black Belt Software Developer

How to debug .NET Windows Services remotely with VS?

Hello dear readers,

I don’t want to repeat what others have said about this topic. In summary you need to download the VS remote debugger which matches your development environment version, the you need to compile a debug version, copy over the DLLs and PDBs to the target server, start the Remote Debugger as Admin, disable Windows Authentication -in the options menu- (please note that once the troubleshooting session is finished you need to disable and stop this process) and attach the local VS debugger to the remote debugger by entering the target server name.

The complete set of instructions is in the following blog:

http://geekswithblogs.net/TheCodeMonkey/archive/2009/05/17/remote-debugging-across-domains-made-easy.aspx

I just want to mention a limitation around remote debugging: it is only supported if the remote and local boxes are in the same domain, which is a pity because usually UAT or PROD environments are in different/controlled domains.

I am aware of different tricks to make this work (e.g.: creating two local users with the exact usernames and passwords in both boxes) but when will MS provide a clean way to debug  remotely in different domains?

Regards,

Javier Andrés Cáceres Alvis

Microsoft Most Valuable Professional – MVP

Intel Black Belt Software Developer

Introduction to Containers, Docker and the Visual Studio Tools For Docker

Hello dear readers,

Recently one of my colleagues asked me about the Docker fundamentals.

This inspired me to create the following 13 mins video about Containers, Docker and the Visual Studio Tools For Docker (audio in Spanish).

I have also shared the presentation which I used below:

Javier Andrés Cáceres Alvis

Microsoft Most Valuable Professional – MVP

Intel Black Belt Software Developer

Crea un blog o un sitio web gratuitos con WordPress.com.

Subir ↑