lainchan / Ω
DICKER/KUBERNETS/etc are being overused and that is cancerous
Jim Hilger · 2020-09-04 22:37
It seems that containers are a new cargo cult in recent years and some software even ships in container form per default (like some internet forums for example) which is plain retarded. It's for system administration what OOP was for programming 10 years ago.
Guthrie · 2020-09-04 22:56
>>32043
You fear what you don't understand
Step 1: Let's make our own OS container from scratch. Since there's no official Arch Linux ARM container on dockerhub, here's how you make one.
#Build using
#wget -r http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz && docker build -t alarm:`date +%Y-%m-%d` .
FROM scratch
ADD os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz /
RUN pacman-key --init
RUN pacman-key --populate archlinuxarm
#Won't need this kernel. Containers use host kernel.
RUN pacman --noconfirm -Rsc linux-aarch64
Anonymous · 2020-09-04 23:10
>>32046
That was easy. Step 2, I want to run a GUI application, but my distro doesn't have it in the package repos. What can I do? I don't want an entirely separate package manager installed on my system just to run my application. Building a package for my distro's repo is very difficult. Containers to the rescue! Here's another dockerfile. This lets me run Eclipse on any ARM64 distro,
# Build with
# docker build -t armclipse:`date +%Y-%m-%d` .
# Installs Eclipse, some plugins, and latest Java
# run with something like
# (Assumes you have the proper directories in your home folder)
#!/bin/sh
#touch /tmp/.docker.xauth;
#XSOCK=/tmp/.X11-unix;
#XAUTH=/tmp/.docker.xauth;
#DOCHOME=/home/armclipse;
#xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -;
#docker run -d --rm -v $XSOCK:$XSOCK -v $XAUTH:$XAUTH -v $HOME/.m2:/home/armclipse/.m2 -e DISPLAY=unix$DISPLAY -e XAUTHORITY=$XAUTH -v $HOME/eclipse/workspaces:$DOCHOME/workspaces -v $HOME/Repos:$DOCHOME/Repos armclipse:2020-09-01 /usr/bin/eclipse -data $DOCHOME/workspaces/default
#
#Then in xfce launcher,
#bash -i -c /home/alarm/eclipse/run.sh
FROM fedora:32
RUN dnf update -y; \
dnf module enable -y eclipse:latest;
RUN dnf install -y eclipse-jdt eclipse-linuxtools eclipse-linuxtools-docker eclipse-dtp eclipse-webtools-sourceediting eclipse-egit-github eclipse-findbugs-contrib eclipse-mylyn eclipse-mylyn-context-* eclipse-mylyn-tasks-* eclipse-mylyn-builds jacoco java-latest-openjdk java-latest-openjdk-javadoc java-latest-openjdk-src java-latest-openjdk-jmods dejavu-sans-fonts dejavu-sans-mono-fonts dejavu-serif-fonts chromium chromedriver binutils nodejs;
RUN sed -i -e 's/-Xmx1024m/-Xmx2048m/g' /usr/lib/eclipse/eclipse.ini; \
useradd -ms /bin/bash armclipse;
RUN alternatives --set java java-latest-openjdk.aarch64;
USER armclipse
RUN /usr/bin/eclipse -noSplash -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/2020-03,https://dl.bintray.com/de-jcup/basheditor -installIUs org.eclipse.m2e.feature.feature.group,org.eclipse.eclemma.feature.feature.group,org.eclipse.wildwebdeveloper.feature.feature.group,de.jcup.basheditor.feature.group; \
/usr/bin/eclipse -initialize;
RUN curl -o /home/armclipse/findsecbugs-plugin-1.10.1.jar -L https://search.maven.org/remotecontent?filepath=com/h3xstream/findsecbugs/findsecbugs-plugin/1.10.1/findsecbugs-plugin-1.10.1.jar
And here's a copy of the icon for your launcher.
Netrunner · 2020-09-04 23:21
>>32047
Another great use for containers is building software. Builds typically require installing lots of clutter in the form of build tools. Once the application is built, you don't want the clutter anymore, just the final product. Building applications in containers makes this possible. Thanks to process isolation offered by containers, running free code from strangers on the internet becomes a less insane proposition.
Zhora · 2020-09-04 23:27
>>32048
While process isolation is great for a lot of things, it can make two containers talking to each other a little difficult. Let's say you have two containers, a database and a server. The server relies on the database, how can I make them work together? This is where docker compose comes in. Docker compose lets you set up your docker networking, docker volumes, and everything else in one file. An example from https://gist.github.com/Warchant/0d0f0104fe7adf3b310937d2db67b512
version: "3"
services:
sonarqube:
image: sonarqube
expose:
- 9000
ports:
- "127.0.0.1:9000:9000"
networks:
- sonarnet
environment:
- SONARQUBE_JDBC_URL=jdbc:postgresql://db:5432/sonar
- SONARQUBE_JDBC_USERNAME=sonar
- SONARQUBE_JDBC_PASSWORD=sonar
volumes:
- sonarqube_conf:/opt/sonarqube/conf
- sonarqube_data:/opt/sonarqube/data
- sonarqube_extensions:/opt/sonarqube/extensions
- sonarqube_bundled-plugins:/opt/sonarqube/lib/bundled-plugins
db:
image: postgres
networks:
- sonarnet
environment:
- POSTGRES_USER=sonar
- POSTGRES_PASSWORD=sonar
volumes:
- postgresql:/var/lib/postgresql
- postgresql_data:/var/lib/postgresql/data
networks:
sonarnet:
volumes:
sonarqube_conf:
sonarqube_data:
sonarqube_extensions:
sonarqube_bundled-plugins:
postgresql:
postgresql_data:
Neato
Cat Mother · 2020-09-04 23:37
>>32050
Composing applications is great and easy to maintain. Keeping them up to date can be as simple as
docker-compose pull;
docker-compose down;
docker-compose up -d;
It's easy to keep adding services, many of which were never in a package repo to begin with. Something like sonarqube is a real pain to set up manually, but with docker, it's much much easier.
Uh oh! I've composed so many services together, my applications no longer fit on a single machine! I tried downloadmoreram.com already, what do I do? This is where kubernetes/docker swarm/etc come in. Kubernetes is like docker-compose for clusters...
Hopefully, this brief tutorial is enough to make you interested in using containers instead of being afraid of them. They really do make my life easier.
Netrunner · 2020-09-04 23:43
>>32043
>everything i don't understand is stupid and pointless
You're just crippling your own potential with that attitude.
Eldon Tyrell · 2020-09-04 23:56
>>32043
The difference between "Design Patterns" OO and Containerization is that Containerization is actually good. The type of OO you learn in school from dot com bust professors is garbage and not at all reflective of what is actually done in engineering.
Docker is fantastic if you use it correctly. If you need to build something that has a lot of complex dependencies it can be a good build environment. You also used another good example - microservices. It is so easy to set up a container for gitlab for example.
Erik Johansson · 2020-09-04 23:57
>>32047
https://github.com/mviereck/x11docker
Crazy Jake · 2020-09-05 02:04
It's not what OOP is for programming, it is what frameworks are for programming.
Makes everything easier but the tradeoff is, more boring and at a loss of control. Who cares about that in most real life scenarios anyway.
Wintermute · 2020-09-05 02:40
>>32043
Remember anon, there are no bad tools in tech only bad devs. You should use the right tool for the job, and in some cases containers are the right tool. You don't want to be like these
>>32047
>>32053
>>32055
>>32061
brain dead idiots/new programmers/bad programmers who think you should containerize everything even when it makes zero sense because thats all the know (we call them "container heads").
Cutter · 2020-09-05 04:09
op, no distro has my wm anymore (wmii)
and its main dependency libixp does not seem to build on any modern distro
do you think docker or kube can resolve my problem?
currently using rio from p9p
Drano · 2020-09-06 06:42
>>32062
>idiots/new programmers/bad programmers
Okay boss, try it. Checkout eclipse source, then compile it on a not x86 platform. Go ahead. Give it a shot. I **dare** you.
Fred Nurk · 2020-09-06 13:26
>>32043
>OOP was for programming 10 years ago
OOP was like 40 years ago
Hououin Kyouma · 2020-09-09 22:51
>>32134
I roll my eyes any time I hear people complain about OOP. Ask 10 different people what OOP means and get 10 different answers.
Nguoi La · 2020-09-18 19:55
>>32230
which only proves that concept of OOP sux
Unnamed · 2020-09-18 19:57
Except Docker solves a real problem and solves it pretty comprehensively. The problem is called "well it works on my machine".
Marly Krushkhova · 2020-09-19 14:40
>>32682
It more proves that most programmers suck. A lot of the core original concepts of OOP are valid its just the OOP practiced in a lot of software is bastardised to hell and back and people apply it to use cases that it is not good at.
Nameless · 2020-09-19 16:30
>>32711
more like you can't even define OOP
any defintion of objects is garbage and useless, aside from maybe actors
OOP code in practice is just a bunch of pseudoscience-tier name juggling, and they adhere to this fake philosophy so strongly that the code quality decreases over if they just coded using default methodology
>>32053
yes, i too use RAD methodology to produce quality code and administration
sage · 2020-09-25 16:20
>>32053
>everything i don't understand is stupid and pointless
yummy stramman m'lord
*chew* *chew* *chew*
Ivan Petrov · 2020-10-08 20:47
>>32683
I really like this encapsulation of the problem-statement
and this applies even when future-me is arguing with past-me about that problem
Nobody special · 2020-10-12 13:40
>>32043
Crazy how you can be so ignorant. Containers are just chroot++. They have a bunch of positive features:
Reproducable environments - "It works on my machine".
Isolation from other services/data/apps - Web Server gets pwned but your n00ds are safe.
Scalable - Having container images that you can migrate or spin mutiple instances of up mean easier scalability and better availability
Low Overhead - They dont require emulating a whole computer or allocating memory to a VM and often share the host kernel
"Repairable" - if a container fails, you deploy a new instance. Repair is trivial and fast.
This is just a naturual evolution of chroot->jail/LXC->Docker
Right now, I am using ezjail flavours on FreeBSD to containerize my services to enforce security boundaries.
Dozer · 2020-10-21 01:15
>>32043
The industry really needs to switch to bocker
https://github.com/p8952/bocker
The Phantom Phreak · 2020-10-21 01:53
Nix, NixOS, and NixOps does everything better than Docker/k8s and more. I've never used a package management system and operating system that has been this nice, and I really cannot see myself going back to imperative-style system administration.
Take the nixpill fellow lains.