Create an Alpine package for jpegoptim

- 1 min

Beberapa waktu yang lalu saya meracik workspace image untuk docker. Kebutuhannya untuk PHP7, Composer, NodeJS dan beberapa tool lain seperti image compressor (pngquant dan jpegoptim). Demi menghemat ukuran image docker, seperti biasa saya menggunakan Alpine.

Khusus untuk pngquant dan jpegoptim saya ambil dari branch edge repository testing dengan cara mengecek terlebih dahulu melalui situs pkgs kedua tool tersebut. Ternyata jpegoptim belum ada dalam paket dan saya memutuskan untuk melakukan kompilasi dalam Dockerfile

...
RUN apk add --no-cache freetype \
      libpng \
      libjpeg-turbo \
      libpq \
      freetype-dev \
      libpng-dev \
      libjpeg-turbo-dev \
      libmcrypt-dev \
      postgresql-dev

...
RUN echo '@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories && \
  apk update && apk add --no-cache wget build-base optipng@testing && \
  wget https://github.com/tjko/jpegoptim/archive/RELEASE.1.4.3.tar.gz -O /tmp/jpegoptim-1.4.3.tar.gz && \
  cd /tmp && tar zxvf jpegoptim-1.4.3.tar.gz && cd /tmp/jpegoptim-RELEASE.1.4.3 && \
  ./configure && make && make strip && make install && \
  apk del --no-cache wget build-base
...

Singkat cerita container saya punya jpegoptim. Tapi karena hari ini minggu, saya memutuskan untuk melakukan hal lebih. Sepertinya asik kalau mencoba membuat paket untuk Alpine. Bermodal link berikut, saya pun mulai menyalakan mesin.

Langsung saja, silahkan ditonton dan semoga bermanfaat.

Aji Kisworo Mukti

Aji Kisworo Mukti

Cengkaruk [Cheng-ka-rook]. Step right up, folks! I'm a seasoned software engineer with over a decade of experience. I was born and raised in the vibrant city of Yogyakarta, and my polyglot abilities are a true asset. With 10+ years of solving complex software problems and the ability to easily switch between programming languages, I bring a fun and unique approach to every project I tackle. So, let's make some amazing software together!

rss facebook twitter github gitlab youtube mail spotify lastfm instagram linkedin google google-plus pinterest medium vimeo stackoverflow reddit quora quora