{"id":16721191,"url":"https://github.com/khalyomede/vlang","last_synced_at":"2025-03-15T12:23:32.538Z","repository":{"id":50568150,"uuid":"373648026","full_name":"khalyomede/vlang","owner":"khalyomede","description":"Docker containers for V.","archived":false,"fork":false,"pushed_at":"2025-03-01T13:27:31.000Z","size":13,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T03:47:39.131Z","etag":null,"topics":["alpine-linux","containers","debian","docker","ubuntu","vlang"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/khalyomede/vlang/tags","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/khalyomede.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-03T21:39:27.000Z","updated_at":"2025-03-01T13:27:34.000Z","dependencies_parsed_at":"2022-08-28T08:50:45.248Z","dependency_job_id":null,"html_url":"https://github.com/khalyomede/vlang","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalyomede%2Fvlang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalyomede%2Fvlang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalyomede%2Fvlang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalyomede%2Fvlang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khalyomede","download_url":"https://codeload.github.com/khalyomede/vlang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243727339,"owners_count":20337978,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpine-linux","containers","debian","docker","ubuntu","vlang"],"created_at":"2024-10-12T22:29:15.676Z","updated_at":"2025-03-15T12:23:32.522Z","avatar_url":"https://github.com/khalyomede.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vlang\r\n\r\nDocker containers for V.\r\n\r\n## Summary\r\n\r\n- [About](#about)\r\n- [Features](#features)\r\n- [Examples](#examples)\r\n- [Available containers](#available-containers)\r\n- [Test](#test)\r\n\r\n## About\r\n\r\nI created these Docker containers to have disposable container for given V versions. I plan to follow V version, as well as each version after the v1 release, so you can choose your containers given the V version and OS of your choice.\r\n\r\n## Features\r\n\r\n- Provides containers for specific V version\r\n- Provide containers that is always up to date with the latest changes (master branch) of the V Github repository\r\n- Provide containers for Alpine Linux, Ubuntu and Debian\r\n\r\n## Examples\r\n\r\n- [1. Using Docker Compose](#1-using-docker-compose)\r\n- [2. Avoid loosing v package using Docker Compose](#2-avoid-loosing-v-package-using-docker-compose)\r\n- [3. Refresh latest image](#3-refresh-latest-image)\r\n\r\n### 1. Using Docker Compose\r\n\r\nIn this example, we will create a container that contains the v executable on Alpine Linux OS.\r\n\r\n```yml\r\nversion: \"3\"\r\nservices:\r\n  v:\r\n    image: khalyomede/vlang:latest-alpine\r\n    entrypoint: v\r\n    volumes:\r\n      - .:/home/alpine\r\n    working_dir: /home/alpine\r\n```\r\n\r\nThen, startup your containers:\r\n\r\n```bash\r\n$ docker-compose up --dettach\r\n```\r\n\r\nFinally, check v is executable:\r\n\r\n```bash\r\n$ docker-compose run v --version\r\nV 0.2.2 f4486d7\r\n```\r\n\r\n### 2. Avoid loosing v package using Docker Compose\r\n\r\nV manages modules on a OS wide folder (like Python), under `/root/.vmodules` (on Linux based OS). In this example, we will mount this folder in our project to keep installed modules.\r\n\r\n```yml\r\nversion: \"3\"\r\nservices:\r\n  v:\r\n    image: khalyomede/vlang:latest-alpine\r\n    entrypoint: v\r\n    volumes:\r\n      - .:/home/alpine\r\n      - ./docker-data/v/root/.vmodules:/root/.vmodules\r\n    working_dir: /home/alpine\r\n```\r\n\r\nThis will create a new `docker-data/v/root/.vmodules` folder in your working folder.\r\n\r\n### 3. Refresh latest image\r\n\r\nLet us say you used the `khalyomede/vlang:latest-alpine` image 3 months ago. You want to use it again for another project. The issue is that your V version will be the one 3 months ago.\r\n\r\nTo fix this, simply call this command:\r\n\r\n```bash\r\ndocker compose pull v\r\n```\r\n\r\nWhere \"v\" is the name of the service that points to the image.\r\n\r\nWhen running `docker compose run v --version`, it should display the latest version the image you used for the service was built for.\r\n\r\nIf your `docker-compose.yml` file use a custom version of the base image provided by this package, because you need a custom executable for example\r\n\r\n```yml\r\nservices:\r\n  v:\r\n    build: ./docker/customized-v\r\n    entrypoint: v\r\n    working_dir: /home/alpine\r\n    volumes:\r\n      - .:/home/alpine\r\n```\r\n\r\nAnd your `docker/customized-v/Dockerfile` looks like this:\r\n\r\n```dockerfile\r\nFROM khalyomede/vlang:latest-alpine\r\n\r\nRUN apk add --no-cache zbar\r\n```\r\n\r\nand you wish this custom image to use the latest changes from the base `khalyomede/vlang:` image, run this command:\r\n\r\n```bash\r\ndocker compose build --no-cache v\r\n```\r\n\r\n## Avaialble containers\r\n\r\nBrowse available tags at [https://hub.docker.com/r/khalyomede/vlang/tags](https://hub.docker.com/r/khalyomede/vlang/tags).\r\n\r\n## Test\r\n\r\nCompile the images\r\n\r\n```bash\r\ndocker build --no-cache src/latest-alpine -t khalyomede/vlang:latest-alpine\r\ndocker build --no-cache src/latest-ubuntu -t khalyomede/vlang:latest-ubuntu\r\ndocker build --no-cache src/latest-debian -t khalyomede/vlang:latest-debian\r\n```\r\n\r\nCreate a docker-compose.yml file\r\n\r\n```yml\r\nversion: \"3\"\r\nservices:\r\n  v:\r\n    build: ./src/latest-alpine\r\n    entrypoint: v\r\n    volumes:\r\n      - .:/home/alpine\r\n    working_dir: /home/alpine\r\n```\r\n\r\nCreate an index.v file\r\n\r\n```v\r\nfn main() {\r\n  println(\"hello world\")\r\n}\r\n```\r\n\r\nStartup your container and test\r\n\r\n```bash\r\n$ docker-compose run v run index.v\r\nhello world\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhalyomede%2Fvlang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhalyomede%2Fvlang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhalyomede%2Fvlang/lists"}