Docker – boot2docker -Share folder

To share another folder than the default one (C:\Users)

First, add the folder to share in VirtualBox

boot2docker-share-drive

Than, connect to the docker VM by running

docker-machine ssh

There you need to run

sudo mkdir --parents //d/tangu
sudo mount -t vboxsf tangu //d/tangu

The first command create the folder where the shared drive will be mounted and the second command actually mount the shared drive.

Of course you’ll need to adapt the paths I used here to match yours.
Note that the mount command takes as arguments

  • -t specifies the filesystem. Here its the one from virtualbox
  • tangu is the named of the shared folder defined in virtual box
  • //d/tangu is the destination of the mount shared drive that was created by the first command

You don’t want to type those commands everytime

Add those lines between the step STEP=”Checking status on $VM” and the step STEP=”Setting env” :

STEP="Mounting web directory"
"${DOCKER_MACHINE}" ssh default 'sudo mkdir --parents //d/tangu'
"${DOCKER_MACHINE}" ssh default 'sudo mount -t vboxsf tangu //d/tangu'

To the file start.sh located where you installed Docker Toolbox

Now everytime you will start boot2docker, it will auto mount this shared folder.

Credits : https://github.com/docker/machine/issues/1814#issuecomment-239957893

 

Docker – boot2docker – Create a new docker virtual machine to a specific location

Yesterday I told about moving the exisitng default boot2docker machine to my secondary hard drive.

Today, I wanted to create a new docker virtual machine directly to a specific location.

docker-machine -s "D:\softwares\Docker Toolbox\docker-vm" create --driver virtualbox machineName

Set as default location

Finally, I want to always use this new location so as mentionned here I created the variable environnement MACHINE_STORAGE_PATH with the path = D:\softwares\Docker Toolbox\docker-vm

Liferay -Include portlet without border in FTL template

Using Liferay 6.2, I needed to dynamically include a portlet in a FTL template using

${theme.runtime(portletId, "", "")}
But I wanted it to have no border.

The doc points to this link but this is valid only for Velocity templates.

Here is the code I used

<#assign portletId= "my_portlet_id" />
<#assign PortletPreferencesFactoryUtil = staticUtil["com.liferay.portlet.PortletPreferencesFactoryUtil"] />
<#assign portletSetup = PortletPreferencesFactoryUtil.getLayoutPortletSetup(layout, portletId) />
<#assign temp = portletSetup.setValue("portletSetupShowBorders", "false") />
<#assign temp = portletSetup.store() />
${theme.runtime(portletId, "", "")}

That comes from that Gist.