Dockerfiles and settings for local development on Rhel 6.10 images via Ansible (mainly)
Since Rhel 6.10 is out of support getting things to work on it (specifically Python 3.x) and Ansible is quite painful
There are also some "gotcha's" to keep in mind when using M1 macs and when trying to avoid using Docker-Desktop which has now been properly monetised
There's also a dockerfile-centos-7 version in here as a bit of a contrast which can be connected to via VSCode.
- Make sure Docker-Desktop is no longer installed
brew install docker docker-compose
- There will likely be instructions to link these two as docker-compose is now a plugin for docker so follow those instructions
- You need a docker runtime for macs - use Colima
- you'll need to run
colima start
to start the docker runtime
docker build
will freak out without the correct settings as you're no longer on an intel/amd platform
Either run all docker tasks with
--platform linux/amd64 flag
export DOCKER_DEFAULT_PLATFORM=linux/amd64
to environment- add
FROM --platform=linux/amd64 <dockerimage>:<version>
to all dockerfiles
Follow these installation instructions You'll want to use the community edition
docker build --platform linux/amd64 -t <dockerimage>:<version> .
docker built -f dockerfile-centos-7 -t <dockerimage>:<version> .
docker run -t -i -d --platform linux/amd64 -v /<local_folder_path>:/<container_folder <dockerimage>:<version>
If the docker image has the relevant glibc and other libraries available then VSCode will be able to connect to the file system for you without having to mount a volume.
docker exec -it <container_id> /bin/bash
http://localhost:9443
> Containers > Select container > Console
If you haven't set the run -i flag you won't be able to easily do this. You can still do it with docker exec -it <container_id> /bin/bash
but you'll need to know the container id
-
Don't run
build
commands from the VSCode terminal. It seems pretty slow and will sometimes randomly timeout getting things from repositories... -
Due to the lack of GCLIB versions in Centos 6.10 you won't be able to connect your VSCode directly to the running container (I tried but something fails, even if you follow the VSCode workaround).
https://www.getpagespeed.com/server-setup/how-to-fix-yum-after-centos-6-went-eol
https://danieleriksson.net/2017/02/08/how-to-install-latest-python-on-centos/