Stan's blog Thanks for stopping by.
Posts with the tag Docker:

Debug PHP in Docker using Xdebug with VS Code or PhpStorm

I’m tired of reading countless of tutorials about this, many of which include a lot of unnecessary steps and do not work on all platform.

To put an end to this, I published a repo: php-xdebug-docker with everything that is necessary to get Xdebug to work with VS Code and PhpStorm when running the PHP code inside a Docker container, including a tutorial for both editors.

The Dockerfile is based on the php:7-apache image. It installs and configure Xdebug. The most important parameters are xdebug.remote_host and xdebug.idekey, which I commented inside the Dockerfile.

Automatically build and push Docker images using GitLab CI

When I began publishing public Docker images, I was using the GitHub integration with the Docker Hub to automatically build and publish my images.

However, the Docker Hub is very slow to build images and has very, very limited configuration options.

Then I discovered Drone which allowed me to build images on my own server, tag them, etc. The thing is I’m limited by the drone-docker plugin and I can’t do everything I want with it.

How to setup a Telegram bot for your Drone CI/CD builds

In my last post I presented Drone, an extremely light CI/CD server.

One cool and satisfying thing is to be automatically notified of the output of your pipelines. In a company, you would probably use a Slack or HipChat bot. For a personal use, I think a Telegram bot is a good idea.

Let’s setup one!

Creating a Telegram bot

Setting up a bot is free and actually very easy. You can do everything from a Telegram client.

Host your own CI/CD server with Drone

Continuous Integration and Continuous Delivery are very trendy topics in the DevOps world right now.

There are quite a lot of services and software to build, test and deploy your code, but actually, a few are free and open-source and self-hostable.

The most well-know softwares corresponding to these characteristics are Jenkins and GitLab CI. However, Jenkins has a huge memory footprint since it runs on Tomcat (Java).

As for GitLab CI, it’s very good but requires you to run your own GitLab (which is huge) or to be on gitlab.com. You can run your own runner independently though.

Install Docker on a ZFS pool

Why? Why would you run Docker on ZFS?

I discovered ZFS when I was playing with LXD, because it’s the recommended storage driver for it.

While ZFS has a lot of great features, the ones I like the most are the RAM cache, compression, and snapshots.

After moving from LXD to Docker (so leaving ZFS), I felt the difference in speed the cache gave me, and I saw some files like databases being 3 times bigger.

Setup a ZFS pool on a Hetzner VM running Debian 9

ZFS is great file system that comes with a lot of benefits, and I’ve come to use on my servers with LXC or Docker.

Even if RAIDZ or self-healing are useless on a VM, we can still benefit from compression, snapshots, cache, etc.

The proper way to create a ZFS pool is to dedicate a device or partition to the zpool.

I’m using the new Hetzner cloud offer a lot recently and that’s also where I use ZFS. They provide ready to go images to get a working VM in 10 seconds, but you can’t repartition them. This tutorials aims to explain how to use the rescue mode to partition the VM and create a zpool.

Diaspora* in Docker

I’ve been moving my services to Docker lately because it suits my needs an ease my life a lot, but I was kind of stuck when wanting to move my Diaspora pod into containers.

Indeed, the Diaspora project doesn’t have any official Docker image, including a Dockerfile, docker-compose.yml or any kind of instructions or guide, because none of the core developers actually use Docker so they’re still searching for someone to maintain one.

Migrating Ghost to Docker

In my first post I said I installed Ghost with ghost-cli, the classic way. I did also say that I wanted to run it in Docker but that I didn’t know Docker enough to do it. In fact, I tried to set up Ghost in Docker a few times while being bored at school, but I didn’t succeed, so it ended up like it is now.

For the past week though, I’ve been learning and using Docker a lot, and finally moved a dozen services into containers.