Skip to content

Commit

Permalink
Use Alpine for dev container
Browse files Browse the repository at this point in the history
  • Loading branch information
vicr123 committed Jul 27, 2024
1 parent 1b6458f commit e995479
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 22 deletions.
4 changes: 4 additions & 0 deletions .codespaces-bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

apk add bash
exec ./.codespaces-setup.sh
4 changes: 3 additions & 1 deletion .codespaces-run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

service postgresql start
mkdir -p /run/postgresql
chown postgres:postgres /run/postgresql
su postgres -c "pg_ctl start -D /var/lib/postgresql/data"
vicr123-accounts &
dotnet dev-certs https
36 changes: 18 additions & 18 deletions .codespaces-setup.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
#!/bin/bash

export DEBIAN_FRONTEND=noninteractive
export LANGUAGE="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"

curl -fsSL https://deb.nodesource.com/setup_18.x | bash - &&\
apt-get update && apt-get install -y --no-install-recommends git cmake postgresql postgresql-contrib libqt6core6 qt6-base-dev build-essential nodejs libqt6sql6-psql dbus-daemon libssh2-1-dev openssh-client
# Rider support
apk add libxext libxrender libxtst libxi freetype procps gcompat

echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
locale-gen
apk add git cmake nodejs postgresql postgresql-contrib qt6-qtbase qt6-qtbase-dev qt6-qtbase-postgresql libssh2-dev openssh cmake build-base ninja dbus dbus-libs

#echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
#locale-gen

mkdir -p /run/postgresql
chown postgres:postgres /run/postgresql
su postgres -c "initdb -D /var/lib/postgresql/data"
su postgres -c "pg_ctl start -D /var/lib/postgresql/data"

service postgresql start
su postgres -c "createuser -s root"
su postgres -c "createuser -s accountsservice"
su postgres -c "createuser -s parlance"
Expand All @@ -24,23 +29,18 @@ psql -c "ALTER USER parlance WITH PASSWORD 'secret'"
cd ..
git clone --recursive https://github.com/vicr123/vicr123-accounts
pushd vicr123-accounts
mkdir build
cd build
cmake ..
cmake --build .
cmake --install .
cmake -S . -B build -GNinja
cmake --build build
cmake --install build
popd

git clone --recursive https://github.com/libgit2/libgit2
pushd libgit2
git checkout v1.8.1
mkdir build
cd build
cmake .. -DUSE_SSH=ON -DBUILD_TESTS=OFF -DBUILD_CLI=OFF
cmake --build .
cmake --install .
cmake -S . -B build -GNinja -DUSE_SSH=ON -DBUILD_TESTS=OFF -DBUILD_CLI=OFF
cmake --build build
cmake --install build
popd


mkdir /var/vicr123-accounts
ln -s /usr/local/lib/libgit2.so /usr/lib/x86_64-linux-gnu/libgit2.so
#ln -s /usr/local/lib/libgit2.so /usr/lib/x86_64-linux-gnu/libgit2.so
6 changes: 3 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"image": "mcr.microsoft.com/dotnet/sdk:8.0-jammy",
"image": "mcr.microsoft.com/dotnet/sdk:8.0-alpine",
"features": {
},
"onCreateCommand": [
"./.codespaces-setup.sh"
"./.codespaces-bootstrap.sh"
],
"postStartCommand": [
"./.codespaces-run.sh"
"./.codespaces-run.sh"
],

// Configure tool-specific properties.
Expand Down

0 comments on commit e995479

Please sign in to comment.