mirror of
https://github.com/dashpay/dash.git
synced 2024-12-23 19:12:47 +01:00
build: add dash minimal development environment container
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
This commit is contained in:
parent
2a28888daf
commit
9bedfa9838
@ -1,3 +1,4 @@
|
||||
**
|
||||
!contrib/containers/ci/Dockerfile
|
||||
!contrib/containers/deploy/Dockerfile
|
||||
!contrib/containers/develop/Dockerfile
|
||||
|
@ -69,6 +69,7 @@ RUN mkdir /dash-src && \
|
||||
chown $USER_ID:$GROUP_ID /dash-src && \
|
||||
chown $USER_ID:$GROUP_ID /cache && \
|
||||
chown $USER_ID:$GROUP_ID /cache -R
|
||||
|
||||
WORKDIR /dash-src
|
||||
|
||||
USER dash
|
||||
|
32
contrib/containers/develop/Dockerfile
Normal file
32
contrib/containers/develop/Dockerfile
Normal file
@ -0,0 +1,32 @@
|
||||
# syntax = edrevo/dockerfile-plus
|
||||
|
||||
FROM ubuntu:focal
|
||||
|
||||
INCLUDE+ ci/Dockerfile
|
||||
|
||||
# The inherited Dockerfile switches to non-privileged context and we've
|
||||
# just started configuring this image, give us root access
|
||||
USER root
|
||||
|
||||
# Discourage root access, this is an interactive instance
|
||||
#
|
||||
# Sometimes these commands are run repetitively _after_ the non-sudo
|
||||
# user was introduced and therefore these commands would fail
|
||||
# To mitigate the build halting, we've added "|| true" so that it
|
||||
# unconditionally returns 0
|
||||
#
|
||||
RUN apt-get update && apt-get install $APT_ARGS sudo && rm -rf /var/lib/apt/lists/*
|
||||
RUN usermod -aG sudo dash
|
||||
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
||||
|
||||
# Make development environment more standalone
|
||||
RUN apt-get update && apt-get install $APT_ARGS nano openssh-client zsh gdb && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Disable noninteractive mode
|
||||
ENV DEBIAN_FRONTEND="dialog"
|
||||
|
||||
# Expose Dash P2P and RPC ports for main network and test networks
|
||||
EXPOSE 9998 9999 19998 19999
|
||||
|
||||
# We're done, switch back to non-privileged user
|
||||
USER dash
|
29
contrib/containers/develop/docker-compose.yml
Normal file
29
contrib/containers/develop/docker-compose.yml
Normal file
@ -0,0 +1,29 @@
|
||||
version: "3.9"
|
||||
services:
|
||||
container:
|
||||
entrypoint: /bin/bash
|
||||
build:
|
||||
context: '..'
|
||||
dockerfile: './develop/Dockerfile'
|
||||
tty: true # Equivalent to -t
|
||||
stdin_open: true # Equivalent to -i
|
||||
ports:
|
||||
- "9998:9998" # Mainnet Ports
|
||||
- "9999:9999"
|
||||
- "19998:19998" # Testnet Ports
|
||||
- "19999:19999"
|
||||
|
||||
# A note about volumes:
|
||||
#
|
||||
# If Docker is interacting with your operating system directly
|
||||
# without an intermediate VM, then you do not need to change anything
|
||||
#
|
||||
# But if not, then you'll need to mount your system's root directory
|
||||
# (i.e. /) into the boot2docker instance if you want to mirror the exact
|
||||
# filesystem structure of your host.
|
||||
#
|
||||
volumes:
|
||||
- type: bind
|
||||
# source: /host/$PWD # Workaround needed on non-Linux hosts
|
||||
source: ../../..
|
||||
target: /dash-src
|
Loading…
Reference in New Issue
Block a user