Official blog of KEINOS but mostly for my own reference. A Japanese made in Mexico with Mexican quality. Who monkey around the jungle of codes. ;-)

Project maintained by KEINOS Hosted on GitHub Pages — Theme by mattgraham


Linux (Alpine Linux)

Must dependencies for building Go binary

This is a list of basic apk packages that must be installed to develop and build Go applications on Alpine Linux.

apk add --no-cache alpine-sdk build-base

How to create user (docker)

FROM alpine:latest

# Create a group and user
RUN addgroup -S appgroup && adduser -S appuser -G appgroup

# Tell docker that all future commands should run as the appuser user
USER appuser

Installing Docker on Alpine Linux

# Install docker, compose and buildx
apk add docker docker-cli-compose docker-cli-buildx
# Add user to docker group
addgroup $(whoami) docker
# Regist docker
rc-update add docker default
service docker start
# Smoke test
docker compose --version
docker run hello-world

Launching Portainer via docker compose

Create self cert for portainer endpoint.

# Move to portainer cert directory to mount
cd /data/portainer/certs

openssl genrsa 2048 > server.key
openssl req -new -key server.key > server.csr
openssl x509 -req -days 3650 -signkey server.key < server.csr > server.crt

Create docker-compose.yml and mount the data and cert directory.

version: "3"
    image: portainer/portainer-ce:latest
      - 9443:9443
      - no-new-privileges:true
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock
      - /data/portainer:/data
      - /data/portainer/certs:/certs
    restart: unless-stopped
      --sslcert /certs/server.crt
      --sslkey /certs/server.key