Giter VIP home page Giter VIP logo

mkdkr's Introduction

mkdkr

Build Status Build Status pipeline status CircleCI GitHub license GitHub release kcov CodeFactor Docker Pulls GitHub all releases

mkdkr = Makefile + Docker

Super small and powerful framework for build CI pipeline, scripted with Makefile and isolated with docker.

Table of contents

Usage

Makefile

Create a file with name Makefile and paste the following content.

Download .mkdkr dynamically.

# Required header
include $(shell [ ! -f .mkdkr ] && curl -fsSL https://git.io/JOBYz > .mkdkr; bash .mkdkr init)

# without shorten url
# include $(shell [ ! -f .mkdkr ] && curl -fsSL https://github.com/rosineygp/mkdkr/releases/latest/download/mkdkr > .mkdkr; bash .mkdkr init)

job:
	@$(dkr)
	instance: alpine
	run: echo "hello mkdkr dynamic!"

OR keep .mkdkr locally.

# Download .mkdkr
curl -fsSL https://github.com/rosineygp/mkdkr/releases/latest/download/mkdkr > .mkdkr
# Required header
include $(shell bash .mkdkr init)

job:
	@$(dkr)
	instance: alpine
	run: echo "hello mkdkr local!"

.gitignore (optional)

.tmp
.mkdkr # only in dynamic config

Execute

# execute
make job

Result

start: job


instance: alpine
20498831fe05f5d33852313a55be42efd88b1fb38b463c686dbb0f2a735df45c

run: echo hello mkdkr!
hello mkdkr!

cleanup:
20498831fe05

completed:
0m0.007s 0m0.000s
0m0.228s 0m0.179s

Export

Run your current Makefile in another engine, like travis or github actions, use the dynamic include exporter.

Demonstration

My Workflow - Configuración automática de CI/CD

My Workflow - Configuración automática de CI/CD

Author: Martin Algañaraz

Reason

Build pipeline for a dedicated platform can take a lot of time to learn and test, with mkdkr you can test all things locally and run it in any pipeline engine like Jenkins, Actions, Gitlab-ci and others.

standards

Functions

@$(dkr)

Load docker layer for mkdkr, use inside a target of Makefile.

shell-only:
	echo "my local shell job"

mkdkr-job:
	@$(dkr)            # load all deps of mkdkr
	intance: alpine
	run: echo "my mkdkr job"

instance:

Create docker containers, without special privileges.

my-instance:
	@$(dkr)
	instance: ubuntu:20.04     # create a instance

Parameters:

  • String, DOCKER_IMAGE *: any docker image name
  • String|Array, ARGS: additional docker init args like (--cpus 1 --memory 64MB)

Return:

  • String, Container Id

Calling instance: twice, it will replace the last container.

service:

Create a docker container in detached mode. Useful to bring up a required service for a job, like a webserver or database.

my-service:
	@$(dkr)
	service: nginx    # up a nginx
	instance: alpine

Is possible start more than one service.

multi-service:
	@$(dkr)
	service: mysql
	service: redis
	instance: node:12
	run: npm install
	run: npm test

* Instance and services are connected in same network
** The name of service is the same of image name with safe values

Image Name Network Name
nginx nginx
nginx:1.2 nginx_1_2
redis:3 redis_3
project/apache_1.2 project_apache_1_2
registry/my/service:latest registry_my_service_latest

replace role 's/:|\.|\/|-/_/g'

Parameters:

  • String, DOCKER_IMAGE *: any docker image name
  • String|Array, ARGS: additional docker init args like (--cpus 1 --memory 64MB)

Return:

  • String, Container Id

instance or dind created after a service, will be automatically linked.

dind:

Create a docker instance with daemon access. Useful to build docker images.

my-dind:
	@$(dkr)
	dind: docker:19
	run: docker build -t my/dind .

Parameters:

  • String, DOCKER_IMAGE *: any docker image name
  • String|Array, ARGS: additional docker init args like (--cpus 1 --memory 64MB)

Return:

  • String, Container Id

run:

Execute a command inside docker container [instance: or dind:] (the last one).

Is not possible to execute commands in a service.

Parameters:

  • String|Array, command: any sh command eg. 'apk add nodejs'

Return:

  • String, Command(s) output

Usage

my-run:
	@$(dkr)
	instance: alpine
	# run a command inside container
	run: apk add curl

	instance: debian
	# avoid escape to host bash, escapes also can be used (eg. \&\&)
	run: 'apt-get update && \
			apt-get install -y curl'

	# run a command inside container and redirect output to host
	run: ls -la > myfile

	# run a command inside container and redirect output to container
	run: 'ls -la > myfile'

var-run:

Execute a command inside docker container [instance: or dind:] and return stdout at named var.

After created var it is passed to next run: or var-run: execution.

Parameters:

  • String, var: any bash valid variable name
  • String|Array, command: any sh command eg. 'apk add nodejs'

Return:

  • String, Command(s) output

Usage

my-var-run:
	@$(dkr)
	instance: alpine
	# run a command inside container
	var-run: myvar hostname
	run: echo '$$myvar'
	var-run: mynewvar echo '$$myvar'
	run: echo "$$myvar $$mynewvar"

login:

Execute docker login in a private registry. If docker instance exist, execute login inside container otherwise at host.

Parameters:

  • String, domain: private registry domain.
  • String| user: registry username.
  • String| password: registry password.

Return:

  • None.

Usage

private-registry:
	@$(dkr)
	login: my.private.registry foo $(MKDKR_PASSWORD)
	instance: my.private.registry/alpine

Execute login at host and download image from private registry (login before instance creation)

private-registry:
	@$(dkr)
	dind: docker:19
	login: my.private.registry foo $(MKDKR_PASSWORD)
	instance:  my.private.registry/alpine

Execute login inside instance and download image from private registry (login after instance creation)

retry:

Execute a command inside docker container [instance: or dind:] (the last one), with retry options.

Is not possible to execute commands in a service.

Parameters:

  • Number|Int, attempts: number of attempts before crash.
  • Number|Int, sleep: time sleeping before retry.
  • String|Array, command: any sh command eg. 'curl https://tomcat:8080'

Return:

  • String, Command(s) output

Usage

deploy:
	@$(dkr)
	instance: oc
	retry: 3 10 oc apply -f build.yml
	#the job can run 3 times with a delay of ten seconds

npm:
	instance: alpine
	run: apk add curl
	service: my-slow-service
	retry: 60 1 curl http://my-slow-service:8080

log:

All output steps executed in a job (except log:) is stored and can be reused during future steps.

Parameters:

  • Number: The number represent the step in a job and start with 0.

Return:

  • Text, Multiline text.

Usage

my-log:
	@$(dkr)
	instance: alpine
	run: apk add curl jq
	run: curl http://example.com
	log: 1 \| jq '.'

push:

Push files/folders to a container job from local filesystem.

Parameters:

  • String, from: Target files/folders in local filesystem.
  • String, to: Destiny of files/folders inside container.

Return

  • None.

Usage

push:
	@$(dkr)
	instance: ansible
	push: /etc/ansible/inventory/hosts.yml
	run: ansible-playbook main.yml

Example

pull:

Pull files/folders from a container job to local filesystem.

Parameters:

  • String, from: Target files/folders inside container.
  • String, to: Destiny of files/folders in local filesystem.

Return

  • None.

Usage

pull:
	@$(dkr)
	instance: debian
	run: curl https://example.com -o /tmp/out.html
	pull: /tmp/out.html .

Example

cd:

Move folder context.

Parameters:

  • String, workdir: Set workdir.

Return

  • None.
change-folder:
	@$(dkr)
	instance: debian
	cd: /tmp
	run: pwd
	# /tmp

Includes

Is possible create jobs or fragments of jobs and reuse it in another projects, like a code package library.

There are two major behavior of includes:

Explicit

A fragment of job (eg. define) and needs to be called explicitly to work.

TAG=latest

define docker_build =
	@$(dkr)
	dind: docker:19
	run: docker build -t $(REGISTRY)/$(PROJECT)/$(REPOS):$(TAG) .
endef

All definitions will be load at start of makefile, after it is possible to call at your custom job.

my-custom-build:
	$(docker-build)

Implicit

Just a full job in another project.

TAG=latest

docker_build:
	@$(dkr)
	dind: docker:19
	run: docker build -t $(REGISTRY)/$(PROJECT)/$(REPOS):$(TAG) .

The jobs will be load at start and can be called directly.

make docker_build
  • No needs to implement the job at main Makefile.
  • Very useful for similar projects.

mkdkr.csv

A file with name mkdkr.csv, that contains the list of remote includes.

Needs to be at same place o main Makefile.

commitlint,https://github.com/rosineygp/mkdkr_commitlint.git,master,main.mk
docker,https://github.com/rosineygp/mkdkr_docker.git

The file contains four values per line in following order

# Name Definition
1 alias * unique identifier of include and clone folder destiny
2 reference * any git clone reference
3 checkout branch, tag or hash that git can checkout (default master)
4 file the fragment of Makefile that will be included (default main.mk)

* required

Collection

Name Description
docker Build and Push Docker images.
commit lint Validate commit message with semantic commit.
exporter Generate pipeline definitions files from Makefile.

Small collection, use it as example

Builtin Targets

_list

List all targets in Makefile, include extensions.

$ make _list

include

alias: exporter, repos: https://github.com/rosineygp/mkdkr_exporter.git, checkout: v1.5.0, file: main.mk

replace: MKDKR_EXPORTER_TAG=latest to v1.5.0
bash.v4-0:
bash.v4-1:
bash.v4-2:
bash.v4-3:
bash.v4-4:
bash.v5-0:
_coverage.report:
examples.dind:
examples.escapes:
examples.pipeline:
examples.retry:
examples.service:
examples.shell:
examples.simple:
examples.stdout:
_exporter_bitbucket-pipelines:
_exporter_circle-ci:
_exporter_github:
_exporter_gitlab-ci:
_exporter_jenkins_pipeline:
_exporter_shell:
_exporter_travis:
lint.commit:
lint.hadolint:
lint.shellcheck:
test.unit:

The result are sorted by name.

First char target name: [a-zA-Z_]

Helpers

A set of small functions to common pipelines process.

Name Description Usage Output
slug Replace unsafe values from a string slug <string> string
urlencode Encode a string to URL format urlencode <string> string
urldecode Decode a string from URL format urldecode <string> string
uuid Generate UUID uuid string
ssh-cp-key Copy ssh private key for current user ssh-cp-key <key-path> none
ssh-host-check Set StrictHostKeyChecking=no ssh-host-check <hostname:port> none
git-user Configure git.user and git.email git-user <email> none
git-ssh Configure ssh and git [ssh-cp-key, ssh-host-check, git-user] git-ssh <key-path> <hostname:port> <email> none
autocommit:
	@$(dkr)
	instance: alpine/git
	git-ssh: ~/.ssh/id_rsa github.com [email protected]
	run: git clone [email protected]:rosineygp/mkdkr.git /auto
	run: echo "my new file" \> /auto/my-new-file.txt
	run: git -C /auto add my-new-file.txt
	run: git -C /auto commit -m "my automatic change"
	run: git -C /auto push origin master:feat/auto-push

Examples

Simple

simple:
	@$(dkr)
	instance: alpine
	run: echo "hello mkdkr!"

Is possible to mix images during job, see in example

Makefile

Service

service:
	@$(dkr)
	service: nginx
	instance: alpine
	run: apk add curl
	run: curl -s nginx

Makefile

DIND

Privileged job

dind:
	@$(dkr)
	dind: docker:19
	run: docker build -t project/repos .

Makefile

Escapes

pipes:
	@$(dkr)
	instance: ubuntu:18.04
	run: "find . -iname '*.mk' -type f -exec cat {} \; | grep -c escapes"

More examples at file

Makefile

Shell

Switch to another shell

shell:
	@$(dkr)
	instance: ubuntu
	export MKDKR_SHELL=bash
	run: 'echo $$0'

More examples at file

Makefile

Stdout

Get output by id

Use to filter or apply some logic in last command executed

stdout:
	@$(dkr)
	instance: alpine
	run: echo "hello mkdkr!"
	run: ps -ef
	log: 1

log: 1 return stout form second command ps -ef

stdout:
	@$(dkr)
	instance: debian
	run: apt-get update
	run: apt-get install curl -y
	run: dpkg -l
	log: 2 | grep -i curl && echo "INSTALLED"

log: 2 return stdout from third command dpkg -l and apply filter

Makefile

Pipelines

Group of jobs for parallel and organization execution

pipeline:
	make test -j 3	# parallel execution
	make build
	make pack
	make deploy

Makefile

Environment Variables

Name Default Description
MKDKR_TTL 3600 The time limit to a job or service run
MKDKR_SHELL sh Change to another shell eg. bash, csh
MKDKR_JOB_STDOUT last stdout Path of file, generated with last stdout output
MKDKR_JOB_NAME* (job|service)_target-name_(uuid) Unique job name, used as container name suffix
MKDKR_INCLUDE_CLONE_DEPTH 1 In the most of case you no need change history for includes
MKDKR_BRANCH_NAME Return current git branch, if it exist
MKDKR_BRANCH_NAME_SLUG Return current git branch, if it exist, with safe values
MKDKR_NETWORK_ARGS Arguments of docker create networks
MKDKR_DOCKER_IMAGE_PULL missing Set "always" to force pull images before docker instance creation
MKDKR_FORCE_DOWNLOAD_INCLUDE "true" for download include files even it already dowloaded [no cached]
  • to overwrite the values use: export <var>=<value>
  • * auto generated

Migration

Migration from release-0.26, just execute the following script on your terminal at root of your project.

curl https://raw.githubusercontent.com/rosineygp/mkdkr/master/.mkdkr > .mkdkr

mkdkr_migration() {
  sed -i 's/\.\.\.\ job\ /instance:\ /g;s/\.\.\.\ service\ /service:\ /g;s/\.\.\.\ privileged\ /dind:\ /g;s/\.\.\.\ /instance:\ /g;s/\.\.\ /run:\ /g;s/@\$(\.)/@\$(dkr)/g' ${1}
}

export -f mkdkr_migration

mkdkr_migration Makefile

find . -iname *.mk -exec bash -c 'mkdkr_migration "$0"' {} \;

mkdkr's People

Contributors

dependabot[bot] avatar neverbehave avatar rosineygp avatar thebouv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mkdkr's Issues

Have alias function names for dot functions

I realise that .. and ... were chosen because "It creates a beautiful code style like yaml", but beauty is very subjective and dot functions are not exactly intuitive (outside of Brainfuck). Especially considering having .. enter into a container when in a shell it leaves/goes up a directory.
I would suggest having aliases e.g. .. could also be dkr_exec and ... could be dkr_start. These are just examples/suggestions and should probably be discussed a little more.

Parallel build error in jenkins

+ make lint.ansible-lint
Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.
fatal: ambiguous argument 'origin/v1.0.0': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
update: bitbucket_auto_review
repos: ssh://git@****.git
checkout: v1.0.0
file: main.mk
fatal: Unable to create '/home/ec2-user/jenkins/workspace/***-mkdkr/.tmp/includes/****/.git/shallow.lock': File exists.

MacOS compatibility

Getting sed and random compatability issues:

sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
cat: /proc/sys/kernel/random/uuid: No such file or directory

Any plans to support MacOS?

An error occurs when cleaning up the docker container

I am getting an error during the cleanup process when using macOS v11.0.1.

Error:
cleanup: xargs: illegal option -- i usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements] [-S replsize]] [-J replstr] [-L number] [-n number [-x]] [-P maxprocs] [-s size] [utility [argument ...]] .../cicd/.tmp/job.log Error response from daemon: error while removing network: network network_job_f527265e-03f5-41d7-819a-1aded78ca67b id 6cc555c1ac34f35dd2b35ed72e45bfc2d28b9a7687fdf45f1f56c50bd7a0660c has active endpoints

Line 267 in the .mkdir is causing the problem...
...|xargs -i{} docker rm -f {} >&2

Note: it works if I change it to be ...| xargs docker rm -f >&2

How do I set environment variables for my services?

Hi I'm working on a basic Elixir/Phoenix project and I need to use a postgresql database, for this I usually build a container like this (as a service):
docker run -p 5432: 5432 -d -e POSTGRES_PASSWORD=postgres - e POSTGRES_USER=postgres -e POSTGRES_DB=justdrawcats -v pgdata: /var/lib/postgresql/data postgres

but I wouldn't know how to do the same with mkdkr. Please, if you could guide me a bit, I would appreciate it, I have tried to do something like that but it doesn't work:

include $(shell [ ! -f .mkdkr ] && curl -fsSL https://git.io/JOBYz > .mkdkr; bash .mkdkr init)

server:
	@$(dkr)
	instance: elixir
	service: postgres
	#export POSTGRES_PASSWORD=postgres
	#export POSTGRES_USER=postgres
	#export POSTGRES_DB=test
	run: mix local.hex --force
	run: iex -S mix phx.server

cant define environment variables based on existing environment variables within container without leaking host environment variables into container

on host:

$ echo $HOME
# prints /home/airtonix

with mkdkr

include $(shell bash tools/mkdkr init)

example:
	@$(dkr)
	instance: ubuntu:20.04
	run: "export PATH=$PATH:/$HOME/something/i/just/installed"
	run: "echo $PATH"

outputs:

$ make -f ./test.mk example

Cannot stat file /proc/3142/fd/0: Permission denied
Cannot stat file /proc/3142/fd/1: Permission denied
Cannot stat file /proc/3142/fd/2: Permission denied
Cannot stat file /proc/3142/fd/3: Permission denied
Cannot stat file /proc/3142/fd/4: Permission denied
Cannot stat file /proc/3142/fd/5: Permission denied
Cannot stat file /proc/3142/fd/6: Permission denied
Cannot stat file /proc/3142/fd/7: Permission denied
Cannot stat file /proc/3142/fd/8: Permission denied
Cannot stat file /proc/3142/fd/9: Permission denied
Cannot stat file /proc/3142/fd/10: Permission denied
Cannot stat file /proc/3142/fd/11: Permission denied
Cannot stat file /proc/3142/fd/12: Permission denied
Cannot stat file /proc/3142/fd/13: Permission denied
Cannot stat file /proc/3142/fd/14: Permission denied
Cannot stat file /proc/3142/fd/15: Permission denied
Cannot stat file /proc/3142/fd/16: Permission denied
Cannot stat file /proc/3142/fd/17: Permission denied
Cannot stat file /proc/3142/fd/18: Permission denied
Cannot stat file /proc/3142/fd/19: Permission denied
Cannot stat file /proc/3142/fd/20: Permission denied
Cannot stat file /proc/3142/fd/21: Permission denied
Cannot stat file /proc/3142/fd/22: Permission denied
Cannot stat file /proc/3142/fd/23: Permission denied
Cannot stat file /proc/3142/fd/24: Permission denied
Cannot stat file /proc/3142/fd/25: Permission denied
Cannot stat file /proc/3142/fd/26: Permission denied
Cannot stat file /proc/3142/fd/27: Permission denied
Cannot stat file /proc/3142/fd/28: Permission denied
Cannot stat file /proc/3142/fd/29: Permission denied
Cannot stat file /proc/3142/fd/30: Permission denied
Cannot stat file /proc/3142/fd/31: Permission denied
Cannot stat file /proc/3142/fd/32: Permission denied
Cannot stat file /proc/3142/fd/33: Permission denied
Cannot stat file /proc/3142/fd/34: Permission denied
Cannot stat file /proc/3142/fd/35: Permission denied
Cannot stat file /proc/3142/fd/36: Permission denied
Cannot stat file /proc/3142/fd/37: Permission denied
Cannot stat file /proc/3142/fd/38: Permission denied
Cannot stat file /proc/3142/fd/39: Permission denied
Cannot stat file /proc/3142/fd/40: Permission denied
Cannot stat file /proc/3142/fd/41: Permission denied
Cannot stat file /proc/3142/fd/42: Permission denied
Cannot stat file /proc/3142/fd/43: Permission denied
Cannot stat file /proc/3142/fd/44: Permission denied
Cannot stat file /proc/3142/fd/45: Permission denied
Cannot stat file /proc/3142/fd/46: Permission denied
Cannot stat file /proc/3142/fd/47: Permission denied
Cannot stat file /proc/3142/fd/48: Permission denied
Cannot stat file /proc/3142/fd/49: Permission denied
Cannot stat file /proc/3142/fd/50: Permission denied
Cannot stat file /proc/3142/fd/51: Permission denied
Cannot stat file /proc/3142/fd/52: Permission denied
Cannot stat file /proc/3142/fd/53: Permission denied
Cannot stat file /proc/3142/fd/54: Permission denied
Cannot stat file /proc/3142/fd/55: Permission denied
Cannot stat file /proc/3142/fd/56: Permission denied
Cannot stat file /proc/3142/fd/57: Permission denied
Cannot stat file /proc/3142/fd/58: Permission denied
Cannot stat file /proc/3142/fd/59: Permission denied
Cannot stat file /proc/3142/fd/60: Permission denied
Cannot stat file /proc/3142/fd/61: Permission denied
Cannot stat file /proc/3142/fd/62: Permission denied
Cannot stat file /proc/3142/fd/63: Permission denied
Cannot stat file /proc/3142/fd/64: Permission denied
Cannot stat file /proc/3142/fd/65: Permission denied
Cannot stat file /proc/3142/fd/66: Permission denied
Cannot stat file /proc/3142/fd/67: Permission denied
Cannot stat file /proc/3142/fd/68: Permission denied
Cannot stat file /proc/3142/fd/69: Permission denied
Cannot stat file /proc/3142/fd/70: Permission denied
Cannot stat file /proc/3142/fd/71: Permission denied
Cannot stat file /proc/3142/fd/72: Permission denied
Cannot stat file /proc/3142/fd/73: Permission denied
Cannot stat file /proc/3142/fd/74: Permission denied
Cannot stat file /proc/3142/fd/75: Permission denied
Cannot stat file /proc/3142/fd/76: Permission denied
Cannot stat file /proc/3142/fd/77: Permission denied
Cannot stat file /proc/3142/fd/78: Permission denied
Cannot stat file /proc/3142/fd/79: Permission denied
Cannot stat file /proc/3142/fd/80: Permission denied
Cannot stat file /proc/3142/fd/81: Permission denied
Cannot stat file /proc/3142/fd/82: Permission denied
Cannot stat file /proc/3142/fd/83: Permission denied
Cannot stat file /proc/3142/fd/84: Permission denied
Cannot stat file /proc/3142/fd/85: Permission denied
Cannot stat file /proc/3142/fd/86: Permission denied
Cannot stat file /proc/3142/fd/87: Permission denied
Cannot stat file /proc/3142/fd/88: Permission denied
Cannot stat file /proc/3142/fd/89: Permission denied
Cannot stat file /proc/3142/fd/90: Permission denied
Cannot stat file /proc/3142/fd/91: Permission denied
Cannot stat file /proc/3142/fd/92: Permission denied
Cannot stat file /proc/3142/fd/102: Permission denied

start: example

network: network_example_0b574d52-4918-44d8-9c63-23e791d9ccf3
cd2e175f741ff459d8133d22cf468226c9209d2e4b93c2dc71d030fe21fdb0db

instance: ubuntu:20.04 
da09d686d516b7b71e4ec844cde504a7bf19ce922b747ab773202d2ba1c7421c

run: export PATH=ATH:/OME/something/i/just/installed

run: echo ATH
ATH

cleanup:
da09d686d516
removed '<redacted>/.tmp/example.log'
network_example_0b574d52-4918-44d8-9c63-23e791d9ccf3

completed:
0m0.006s 0m0.003s
0m0.286s 0m0.232s

so i try instead:

include $(shell bash tools/mkdkr init)

example:
	@$(dkr)
	instance: ubuntu:20.04
	run: "export PATH=$$PATH:/$$HOME/something/i/just/installed"
	run: "echo $$PATH"

outputs:

$ make -f ./test.mk example

Cannot stat file /proc/3142/fd/0: Permission denied
# clip millions of lines like this 
Cannot stat file /proc/3142/fd/102: Permission denied

start: example

network: network_example_60205d85-be1e-4832-a85a-9cdd17df29fa
ba6f9156a00981b949dd8cdf28d7a7fe13b0963d521723c525a95a1ce284b444

instance: ubuntu:20.04 
7bb29d75689f1ff96d689d9c69e435f135aaadbbd4714fa3dc03a94ab516c57b

run: export PATH=/home/airtonix/Applications/balena-cli:/home/airtonix/Applications:/home/airtonix/.local/bin:/home/airtonix/.rvm/gems/ruby-2.4.10/bin:/home/airtonix/.rvm/gems/ruby-2.4.10@global/bin:/home/airtonix/.rvm/rubies/ruby-2.4.10/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/airtonix/bin:/home/airtonix/bin:/home/airtonix/.rvm/bin:/home/airtonix/.volta/bin::/tools:/platform-tools:/home/airtonix/.rvm/bin://home/airtonix/something/i/just/installed

run: echo /home/airtonix/Applications/balena-cli:/home/airtonix/Applications:/home/airtonix/.local/bin:/home/airtonix/.rvm/gems/ruby-2.4.10/bin:/home/airtonix/.rvm/gems/ruby-2.4.10@global/bin:/home/airtonix/.rvm/rubies/ruby-2.4.10/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/airtonix/bin:/home/airtonix/bin:/home/airtonix/.rvm/bin:/home/airtonix/.volta/bin::/tools:/platform-tools:/home/airtonix/.rvm/bin
/home/airtonix/Applications/balena-cli:/home/airtonix/Applications:/home/airtonix/.local/bin:/home/airtonix/.rvm/gems/ruby-2.4.10/bin:/home/airtonix/.rvm/gems/ruby-2.4.10@global/bin:/home/airtonix/.rvm/rubies/ruby-2.4.10/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/airtonix/bin:/home/airtonix/bin:/home/airtonix/.rvm/bin:/home/airtonix/.volta/bin::/tools:/platform-tools:/home/airtonix/.rvm/bin

cleanup:
7bb29d75689f
removed '<redacted>/.tmp/example.log'
network_example_60205d85-be1e-4832-a85a-9cdd17df29fa

completed:
0m0.004s 0m0.006s
0m0.310s 0m0.206s

when env | grep PATH in the container actually reports:

$ make -f ./test.mk env

Cannot stat file /proc/3142/fd/102: Permission denied
# clip millions of lines like this 
Cannot stat file /proc/3142/fd/102: Permission denied

start: env

network: network_env_888f28e0-cd24-4698-bd2d-437f34afab73
98acb09c9516dc953173ae26d0d689174ad3226215b7da8333da5684a969a3a9

instance: ubuntu:20.04 
9db84fbff6fedcf09d596e31886422b54b9fb30523b9790323b3f58392c0214c

run: env | grep PATH
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

cleanup:
9db84fbff6fe
removed '/home/zenobius/Projects/Work/Reckon/reckon-mobile/.tmp/env.log'
network_env_888f28e0-cd24-4698-bd2d-437f34afab73

completed:
0m0.005s 0m0.003s
0m0.267s 0m0.208s

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.