This is an old revision of the document!


Dockerfile Filetype

Dockerfile is a file format used to build Docker images.

Docker is a computer program that performs operating-system-level virtualization, also known as “containerization”

This page describe how to add basic Dockerfile syntax highlighting on Geany.

Add the following lines to ~/.config/geany/filetype_extensions.conf under the respective sections [Extensions] and [Groups]

[Extensions]
Dockerfile=Dockerfile;dockerfile;*.dockerfile;*.Dockerfile;
[Groups]
Script=Dockerfile;

Save the configuration file below in your Geany filetype definition files config directory, e.g. ~/.config/geany/filedefs/filetypes.Dockerfile.conf

NB: Note that this filetype definition file is in version 0.1, meaning it can be used but needs improvement.

filetypes.Dockerfile.conf
# For complete documentation of this file, please see Geany's main documentation
#
# Geany Color Syntax support for Dockerfiles 
#
# It can also parse docker-compose files, 
# but requires commenting out the YAML-row in the Geany installation filetype_extensions.conf 
# 
# version 0.2
#
# 0.1 - estadieu.pl@gmail.com   # original version
# 0.2 - axelsson.jan@gmail.com  # base on Sh instead - fixes problems with //, #, /* 
 
[styling=C]
 
[keywords]
primary= ADD ARG CMD COPY ENTRYPOINT ENV EXPOSE FROM HEALTHCHECK LABEL ONBUILD RUN SHELL STOPSIGNAL USER VOLUME WORKDIR build container_name context command default depends_on dns dockerfile entrypoint environment env_file expose external extra_hosts external_links file hostname image labels links name network ports service services volumes web devices 
 
[lexer_properties=C]
 
[settings]
lexer_filetype=Sh
tag_parser=C
extension=
# single comments, like # in this file
comment_single=#
 
# set to false if a comment character/string should start at column 0 of a line, true uses any
# indentation of the line, e.g. setting to true causes the following on pressing CTRL+d
	#command_example();
# setting to false would generate this
#	command_example();
# This setting works only for single line comments
comment_use_indent=true
# context action command (please see Geany's main documentation for details)
context_action_cmd=xdg-open "https://docs.docker.com/engine/reference/builder/"

Finally, add the following line to the data Makefile ~/data/Makefile.am

Makefile.am
filedefs/filetypes.Dockerfile.conf
Print/export