-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make container stuff compatible with podman, add devcontainer support
- Loading branch information
=
committed
Jun 16, 2024
1 parent
788a5f5
commit b041080
Showing
9 changed files
with
637 additions
and
141 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,74 @@ | ||
{ | ||
"name": "isp-net-adminator", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
// "image": "opencodeco/phpctl:php83-devcontainer", | ||
"image" : "php:5.6-apache", | ||
"postCreateCommand": "composer install", | ||
"features": { | ||
// Install the Dapr CLI | ||
// "ghcr.io/dapr/cli/dapr-cli:0": {}, | ||
"ghcr.io/devcontainers/features/sshd:1": {}, | ||
// Enable Docker (via Docker-in-Docker) | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": {} | ||
} | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html" | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json", | ||
|
||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu | ||
|
||
"name": "isp-net-adminator", | ||
|
||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
// "image": "mcr.microsoft.com/devcontainers/base:jammy", | ||
|
||
"dockerComposeFile": [ | ||
"../docker-compose.yml", | ||
"docker-compose.extend.yml" | ||
], | ||
|
||
"service": "fpm", | ||
|
||
"workspaceFolder": "/srv/www", | ||
|
||
"shutdownAction": "stopCompose", | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
"features": { | ||
}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "bash scripts/devcontainers-post-commands.sh", | ||
|
||
// Configure tool-specific properties. | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
// "ms-azuretools.vscode-docker" | ||
// ,"mads-hartmann.bash-ide-vscode" | ||
// , | ||
// "EditorConfig.EditorConfig" | ||
] | ||
} | ||
}, | ||
|
||
// Uncomment to connect as root instead. | ||
// More info: https://aka.ms/dev-containers-non-root. | ||
// Docs: https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user | ||
"remoteUser": "vscode" | ||
|
||
// podman specific | ||
// https://code.visualstudio.com/remote/advancedcontainers/docker-options#_podman | ||
// , | ||
// "runArgs": [ | ||
// // run container as current user | ||
// // "--userns=keep-id" | ||
// // , | ||
// // // mount user home directory for things like git, ssh, and other configs | ||
// // "--volume=${env:HOME}:${env:HOME}", | ||
// // // ensure project directory is mounted incase it exists outside the home directory | ||
// // "--volume=${localWorkspaceFolder}:${localWorkspaceFolder}", | ||
// // isolate the .vscode-server folder so you don't overwrite settings from remote ssh vscode | ||
// //"--volume=${localWorkspaceFolder}/.cache/vscode-server:${env:HOME}/.vscode-server" | ||
// ] | ||
, | ||
"containerEnv": { | ||
// ensure users home directory is the same inside the container as it is outside | ||
"HOME": "/home/vscode" | ||
|
||
} | ||
// podman workaround for "mkdir: cannot create directory '/root': Permission denied" | ||
// https://blog.lifeishao.com/post/vscode-replace-docker-with-podman/ | ||
// , | ||
// "containerUser": "vscode" // the value needs to match the value of "remoteUser" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
services: | ||
fpm: | ||
build: | ||
# context: ../ | ||
dockerfile: .devcontainer/Dockerfile | ||
# target: main | ||
# args: | ||
# progress: plain | ||
volumes: | ||
# Mounts the project folder to '/workspace'. While this file is in .devcontainer, | ||
# mounts are relative to the first file in the list, which is a level up. | ||
- .:/srv/www:cached | ||
|
||
# [Optional] Required for ptrace-based debuggers like C++, Go, and Rust | ||
cap_add: | ||
- SYS_PTRACE | ||
security_opt: | ||
- seccomp:unconfined | ||
|
||
# Overrides default command so things don't shut down after the process ends. | ||
command: /bin/sh -c "while sleep 1000; do :; done" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.