Category: docker

Run crontab within Alpinelinux Docker image

This post will explain how we can run cronjobs within Docker image based on Alpine Linux distribution, so am going to use my newest PHP 7.2 docker image, which you can find at zaherg/php-7.2-xdebug-alpine .

First, we will have to pull the docker image using the command:

Now that we have downloaded the image, we will have to familiarize our self with the structure for the periodic directory which we can find under /etc/periodic, this directory should contain the following folders:

  1. 15min
  2. hourly
  3. daily
  4. weekly
  5. monthly

Continue reading

Filed under: Code, docker, Linux

Using Minio server for simulate S3 locally

The other day, I was building a small development environment for me to test Laravel and S3, but as usual, I didn’t want to use production credentials nor to use S3 directly, so after a small search I found Minio :

Minio is an open source object storage server with Amazon S3 compatible API. 
Build cloud-native applications portable across all major public and private clouds.

And I was so happy, as I’ll be able to use S3 locally and wont worry about hitting outside my local network, I pulled the docker image, and then I realize that I’ll have to specify the command to run and some environment variables which okay for local development, but it wont work with Bitbucket Pipelines, so my tests wont work.

you can read this tweet and the list of tweets under it

So what I did was to build a new docker image that will have everything up and running, the content of the Dockerfile was

which is simple and nice, but again wont be that much helpful, as I need to have two default buckets created automatically for me, so I altered the file to create a new directories under the /data directory.

Continue reading

Filed under: Code, docker

New fresh start, many things to end

Starting from today, the plan is to catch up with everything I have missed in the past few years, so there will be a lot of reading and a lot of side projects to learn even more.

The main points which I’ll try to cover while searching for a new opportunity are:

  1. Laravel 5: I did missed a lot of the new things that has happened to Laravel in past few years, I was concentrating on using it more than learning the main components individually, this hopefully will change as I’ll have to put some time to read and check the internal Illuminate components, and maybe build some packages while am doing so.
  2. Docker: yes I’ve talked about me trying to learn Docker a lot in the past, and it was a fun and exciting experience, so now its the time to put what I have learned in more production ready state, to deploy and learn more about how we can use it in production.
  3. Microservices: so in the past few months I spend 99% of my time deploying microservices in the company, which they do one thing only, so now its time for me to read more and see how can I group microservices in one big system that can communicate internally with each other, and yes by utilizing what I have learned about Docker.

So maybe they are a lot of things to do, but now that am on a break I might have the time to do that, and finish also most of the courses that I have bought but never found the time to finish.

Also, if you have any idea which you want someone to help you develop, you can communicate with me via the contact form.

Filed under: Business, docker, Laravel, Personal

Manually run your Bitbucket Pipelines

In the earlier post, we have talked about how to test your Laravel  application with Bitbucket Pipelines, but sometimes you may need to run the tests on specific commit and not after you push it, luckily for us Bitbucket Pipelines team has implemented the custom section in the ymal file, which helps us to do so.

It does not differ that much from what we already have, so adding the following to our file which we created in the earlier  post will enable us to manually run the pipeline:

Continue reading

Filed under: Code, docker, PHP

How to test your Laravel application with Bitbucket Pipelines

Bitbucket Pipelines is a CI service that you can use to test your application, yes it has its own limitation, but remember it is still new and hopefully it will get better. Today I had the chance to work with it, and trust me I was not planning to do so, am a happy Gitlab-ci user, but why not.

Each of these service has its pros and cons, and am not planning to go over it and list it, just do a small reading to find the differences, so today I’ll talk about how to test your Laravel Application with Bitbucket Pipelines and how you can get it fast.

Requirements:

For sure you need to know Laravel and how to write tests, this post will not talk about it, and it would be nice if you know a little bit of Docker.

Enabling Pipelines:

You will need to enable the pipelines from the Repository Settings as the following image

Continue reading

Filed under: Code, docker, Laravel, PHP