Browse Source

Merge branch 'develop'

master
Rohan Verma 6 years ago
parent
commit
8c78b68eed
2 changed files with 12 additions and 10 deletions
  1. +10
    -8
      content/blog/2019/2019-11-05-docker-gopls.md
  2. +2
    -2
      content/blog/2019/2019-11-15-selfhosted-netlify.md

+ 10
- 8
content/blog/2019/2019-11-05-docker-gopls.md View File

``` ```


Firstly, we install all the dependencies and then create Firstly, we install all the dependencies and then create
a user which will have access to the source code.
a user which will have access to the source code. We pass
the same user ID as our host user by using the MY_USER_ID
as the build argument.


Then we have to replicate the Then we have to replicate the
host path in the container and set that as our work directory. This is a quirk host path in the container and set that as our work directory. This is a quirk
mkdir -p go mkdir -p go


docker build \ docker build \
--build-arg MY_PWD=${PWD} \
--build-arg=MY_USER_ID=${MY_USER_ID} \
--build-arg MY_PWD=$PWD \
--build-arg=MY_USER_ID=`id -u $USER` \
-t myapp:latest . -t myapp:latest .
``` ```




```bash ```bash
docker run -d --name "myapp" \ docker run -d --name "myapp" \
-u `id -u ${USER}` \
-e "GOPATH=${PWD}/go" \
-u `id -u $USER` \
-e "GOPATH=$PWD/go" \
-p 7050:7050 \ -p 7050:7050 \
-v ${PWD}:${PWD} myapp:latest
-v $PWD:$PWD myapp:latest
``` ```


Notice, that we also mount the host source in the container with the same path, Notice, that we also mount the host source in the container with the same path,
``` ```


After adding this flag, you will now be able to edit your source with all the After adding this flag, you will now be able to edit your source with all the
added benefits that come with a language server like autocompletion and
autoformatting.
added benefits that come with a language server like auto completion and
auto formatting.


Since this is an experimental feature, it might break (a lot). Do let me know Since this is an experimental feature, it might break (a lot). Do let me know
in the comments if this was helpful for you. in the comments if this was helpful for you.

+ 2
- 2
content/blog/2019/2019-11-15-selfhosted-netlify.md View File

+++ +++
title = "Self hosted Netlify using docker-compose, gitea, and drone-ci" title = "Self hosted Netlify using docker-compose, gitea, and drone-ci"
date = 2019-11-15T15:30:03+05:30
date = 2019-11-16T15:30:03+05:30
draft = true draft = true
tags = ["golang", "docker", "self hosted"] tags = ["golang", "docker", "self hosted"]
categories = ["tutorials"] categories = ["tutorials"]
type = "post" type = "post"
url = "blog/2019/11/15/selfhosted-netlify"
url = "blog/2019/11/16/selfhosted-netlify"
author = "Rohan Verma" author = "Rohan Verma"
+++ +++



Loading…
Cancel
Save